Java Code Examples for com.pluscubed.logcat.data.LogLine#setExpanded()

The following examples show how to use com.pluscubed.logcat.data.LogLine#setExpanded() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: LogcatActivity.java    From java-n-IDE-for-Android with Apache License 2.0 6 votes vote down vote up
@Override
public void onClick(final View itemView, final LogLine logLine) {
    if (partialSelectMode) {
        logLine.setHighlighted(true);
        partiallySelectedLogLines.add(logLine);

        mHandler.post(new Runnable() {
            @Override
            public void run() {
                mLogListAdapter.notifyItemChanged(binding.list.getChildAdapterPosition(itemView));
            }
        });

        if (partiallySelectedLogLines.size() == 2) {
            // last line
            completePartialSelect();
        }
    } else {
        logLine.setExpanded(!logLine.isExpanded());
        mLogListAdapter.notifyItemChanged(binding.list.getChildAdapterPosition(itemView));
    }
}
 
Example 2
Source File: LogcatActivity.java    From javaide with GNU General Public License v3.0 6 votes vote down vote up
@Override
public void onClick(final View itemView, final LogLine logLine) {
    if (partialSelectMode) {
        logLine.setHighlighted(true);
        partiallySelectedLogLines.add(logLine);

        mHandler.post(new Runnable() {
            @Override
            public void run() {
                mLogListAdapter.notifyItemChanged(binding.list.getChildAdapterPosition(itemView));
            }
        });

        if (partiallySelectedLogLines.size() == 2) {
            // last line
            completePartialSelect();
        }
    } else {
        logLine.setExpanded(!logLine.isExpanded());
        mLogListAdapter.notifyItemChanged(binding.list.getChildAdapterPosition(itemView));
    }
}
 
Example 3
Source File: LogcatActivity.java    From matlog with GNU General Public License v3.0 6 votes vote down vote up
@Override
public void onClick(final View itemView, final LogLine logLine) {
    if (partialSelectMode) {
        logLine.setHighlighted(true);
        partiallySelectedLogLines.add(logLine);

        mHandler.post(() -> mLogListAdapter.notifyItemChanged(((RecyclerView) findViewById(R.id.list)).getChildAdapterPosition(itemView)));

        if (partiallySelectedLogLines.size() == 2) {
            // last line
            completePartialSelect();
        }
    } else {
        logLine.setExpanded(!logLine.isExpanded());
        mLogListAdapter.notifyItemChanged(((RecyclerView) findViewById(R.id.list)).getChildAdapterPosition(itemView));
    }
}
 
Example 4
Source File: LogcatActivity.java    From java-n-IDE-for-Android with Apache License 2.0 3 votes vote down vote up
private void expandOrCollapseAll(boolean change) {

        mCollapsedMode = change != mCollapsedMode;

        int oldFirstVisibleItem = ((LinearLayoutManager) binding.list.getLayoutManager()).findFirstVisibleItemPosition();

        for (LogLine logLine : mLogListAdapter.getTrueValues()) {
            if (logLine != null) {
                logLine.setExpanded(!mCollapsedMode);
            }
        }

        mLogListAdapter.notifyDataSetChanged();

        // ensure that we either stay autoscrolling at the bottom of the list...

        if (mAutoscrollToBottom) {

            scrollToBottom();

            // ... or that whatever was the previous first visible item is still the current first
            // visible item after expanding/collapsing

        } else if (oldFirstVisibleItem != -1) {

            binding.list.scrollToPosition(oldFirstVisibleItem);
        }

        supportInvalidateOptionsMenu();
    }
 
Example 5
Source File: LogcatActivity.java    From javaide with GNU General Public License v3.0 3 votes vote down vote up
private void expandOrCollapseAll(boolean change) {

        mCollapsedMode = change != mCollapsedMode;

        int oldFirstVisibleItem = ((LinearLayoutManager) binding.list.getLayoutManager()).findFirstVisibleItemPosition();

        for (LogLine logLine : mLogListAdapter.getTrueValues()) {
            if (logLine != null) {
                logLine.setExpanded(!mCollapsedMode);
            }
        }

        mLogListAdapter.notifyDataSetChanged();

        // ensure that we either stay autoscrolling at the bottom of the list...

        if (mAutoscrollToBottom) {

            scrollToBottom();

            // ... or that whatever was the previous first visible item is still the current first
            // visible item after expanding/collapsing

        } else if (oldFirstVisibleItem != -1) {

            binding.list.scrollToPosition(oldFirstVisibleItem);
        }

        supportInvalidateOptionsMenu();
    }
 
Example 6
Source File: LogcatActivity.java    From matlog with GNU General Public License v3.0 3 votes vote down vote up
private void expandOrCollapseAll(boolean change) {

        mCollapsedMode = change != mCollapsedMode;

        int oldFirstVisibleItem = ((LinearLayoutManager) ((RecyclerView) findViewById(R.id.list)).getLayoutManager()).findFirstVisibleItemPosition();

        for (LogLine logLine : mLogListAdapter.getTrueValues()) {
            if (logLine != null) {
                logLine.setExpanded(!mCollapsedMode);
            }
        }

        mLogListAdapter.notifyDataSetChanged();

        // ensure that we either stay autoscrolling at the bottom of the list...

        if (mAutoscrollToBottom) {

            scrollToBottom();

            // ... or that whatever was the previous first visible item is still the current first
            // visible item after expanding/collapsing

        } else if (oldFirstVisibleItem != -1) {

            ((RecyclerView) findViewById(R.id.list)).scrollToPosition(oldFirstVisibleItem);
        }

        supportInvalidateOptionsMenu();
    }