Android Open Source - FMdroid Checkable Item






From Project

Back to project page FMdroid.

License

The source code is released under:

Apache License

If you think the Android project FMdroid listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.

Java Source Code

package com.doodeec.filemanager.UIComponents;
//ww w.  ja  v a  2s  .co  m
import android.content.Context;
import android.util.AttributeSet;
import android.widget.Checkable;
import android.widget.RelativeLayout;

/**
 * Created by Dusan Doodeec Bartos on 4.10.2014.
 *
 * Component used to allow selecting gridView items
 */
@SuppressWarnings("unused")
public class CheckableItem extends RelativeLayout implements Checkable {
    private boolean mChecked = false;
    private static final int[] CHECKED_STATE_SET = { android.R.attr.state_checked };

    public CheckableItem(Context context) {
        super(context);
    }

    public CheckableItem(Context context, AttributeSet attrs) {
        super(context, attrs);
    }

    public CheckableItem(Context context, AttributeSet attrs, int defStyle) {
        super(context, attrs, defStyle);
    }

    @Override
    protected int[] onCreateDrawableState(int extraSpace) {
        final int[] drawableState = super.onCreateDrawableState(extraSpace + 1);
        if (isChecked())
            mergeDrawableStates(drawableState, CHECKED_STATE_SET);
        return drawableState;
    }

    @Override
    public boolean isChecked() {
        return mChecked;
    }

    @Override
    public void setChecked(boolean isChecked) {
        mChecked = isChecked;
        refreshDrawableState();
    }

    @Override
    public void toggle() {
        setChecked(!mChecked);
    }
}




Java Source Code List

com.doodeec.filemanager.BaseActivity.java
com.doodeec.filemanager.PickerActivity.java
com.doodeec.filemanager.SettingsActivity.java
com.doodeec.filemanager.FileManagement.FolderManipulationInterface.java
com.doodeec.filemanager.FileManagement.StorageItemHolder.java
com.doodeec.filemanager.FileManagement.StorageManager.java
com.doodeec.filemanager.FileManagement.Model.StorageItem.java
com.doodeec.filemanager.UIComponents.CheckableItem.java
com.doodeec.filemanager.UIComponents.FolderAdapter.java
com.doodeec.filemanager.UIComponents.FolderFragment.java
com.doodeec.filemanager.UIComponents.SlidingFrameLayout.java