Android Open Source - Rashr Recyclable Card






From Project

Back to project page Rashr.

License

The source code is released under:

GNU General Public License

If you think the Android project Rashr 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.fima.cardsui.objects;
//w  w  w.ja  va 2s  .  c o  m
import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;

/**
 * A card that can be recycled when scrolled off screen.
 */
public abstract class RecyclableCard extends Card {

    public RecyclableCard() {
        super();
    }

    public RecyclableCard(String title, int image) {
        super(title, image);
    }

    public RecyclableCard(String titlePlay, String description, int imageRes,
                          String titleColor, Boolean hasOverflow, Boolean isClickable) {
        super(titlePlay, description, imageRes, titleColor, hasOverflow, isClickable);
    }

    public RecyclableCard(String title, String desc, int image) {
        super(title, desc, image);
    }

    public RecyclableCard(String titlePlay, String description, String color,
                          String titleColor, Boolean hasOverflow, Boolean isClickable) {
        super(titlePlay, description, color, titleColor, hasOverflow, isClickable);
    }

    public RecyclableCard(String title, String desc) {
        super(title, desc);
    }

    public RecyclableCard(String title) {
        super(title);
    }

    /**
     * Set the values of child views.  The view will not be null and
     * is guaranteed to have the layout of the root element equal to
     * the layout resource ID from getCardLayoutId().
     * @param convertView non-null view to modify
     */
    protected abstract void applyTo(View convertView);

    /**
     * Get the R.layout ID of the root element of the content of the card.
     * This value will be used to inflate the card and check whether an
     * old card's View can be recycled.
     * @return layout ID of the card content
     */
    protected abstract int getCardLayoutId();

    @Override
    public View getCardContent(Context context) {
        View view = LayoutInflater.from(context).inflate(getCardLayoutId(), null);
        applyTo(view);
        return view;
    }

    @Override
    public boolean convert(View convertCardView) {
        View view = convertCardView.findViewById(getCardLayoutId());
        if (view == null) {
            return false;
        }

        applyTo(view);
        return true;
    }

}




Java Source Code List

com.fima.cardsui.StackAdapter.java
com.fima.cardsui.SwipeDismissTouchListener.java
com.fima.cardsui.Utils.java
com.fima.cardsui.objects.AbstractCard.java
com.fima.cardsui.objects.CardFactory.java
com.fima.cardsui.objects.CardModel.java
com.fima.cardsui.objects.CardStack.java
com.fima.cardsui.objects.Card.java
com.fima.cardsui.objects.RecyclableCard.java
com.fima.cardsui.views.CardUI.java
com.fima.cardsui.views.MyCard.java
com.fima.cardsui.views.MyImageCard.java
com.fima.cardsui.views.MyPlayCard.java
com.fima.cardsui.views.QuickReturnListView.java
de.mkrtchyan.recoverytools.BackupRestoreFragment.java
de.mkrtchyan.recoverytools.Constants.java
de.mkrtchyan.recoverytools.Device.java
de.mkrtchyan.recoverytools.FlashAsFragment.java
de.mkrtchyan.recoverytools.FlashFragment.java
de.mkrtchyan.recoverytools.FlashUtil.java
de.mkrtchyan.recoverytools.NavigationDrawerFragment.java
de.mkrtchyan.recoverytools.RashrActivity.java
de.mkrtchyan.recoverytools.ReportDialog.java
de.mkrtchyan.recoverytools.ScriptManagerFragment.java
de.mkrtchyan.recoverytools.SettingsFragment.java
de.mkrtchyan.utils.Common.java
de.mkrtchyan.utils.Downloader.java
de.mkrtchyan.utils.FileChooserDialog.java
de.mkrtchyan.utils.FileListView.java
de.mkrtchyan.utils.Notifyer.java
de.mkrtchyan.utils.SHA1.java
de.mkrtchyan.utils.Unzipper.java
donations.DonationsFragment.java
donations.google.util.Base64DecoderException.java
donations.google.util.Base64.java
donations.google.util.IabException.java
donations.google.util.IabHelper.java
donations.google.util.IabResult.java
donations.google.util.Inventory.java
donations.google.util.Purchase.java
donations.google.util.Security.java
donations.google.util.SkuDetails.java
org.sufficientlysecure.rootcommands.Mount.java
org.sufficientlysecure.rootcommands.Remounter.java
org.sufficientlysecure.rootcommands.RootCommands.java
org.sufficientlysecure.rootcommands.Shell.java
org.sufficientlysecure.rootcommands.SystemCommands.java
org.sufficientlysecure.rootcommands.Toolbox.java
org.sufficientlysecure.rootcommands.command.BinaryCommand.java
org.sufficientlysecure.rootcommands.command.Command.java
org.sufficientlysecure.rootcommands.command.SimpleBinaryCommand.java
org.sufficientlysecure.rootcommands.command.SimpleCommand.java
org.sufficientlysecure.rootcommands.util.BrokenBusyboxException.java
org.sufficientlysecure.rootcommands.util.FailedExecuteCommand.java
org.sufficientlysecure.rootcommands.util.Log.java
org.sufficientlysecure.rootcommands.util.RootAccessDeniedException.java
org.sufficientlysecure.rootcommands.util.UnsupportedArchitectureException.java
org.sufficientlysecure.rootcommands.util.Utils.java