Search in sources :

Example 1 with QuickReturnListViewOnScrollListener

use of com.etiennelawlor.quickreturn.library.listeners.QuickReturnListViewOnScrollListener in project QuickReturn by lawloretienne.

the class QuickReturnFooterListViewFragment method onViewCreated.

@Override
public void onViewCreated(View view, Bundle savedInstanceState) {
    super.onViewCreated(view, savedInstanceState);
    mValues = getResources().getStringArray(R.array.countries);
    ArrayAdapter<String> adapter = new ArrayAdapter<>(getActivity(), R.layout.list_item, R.id.item_tv, mValues);
    mListView.setAdapter(adapter);
    int footerHeight = getActivity().getResources().getDimensionPixelSize(R.dimen.footer_height);
    QuickReturnListViewOnScrollListener scrollListener;
    SpeedyQuickReturnListViewOnScrollListener scrollListener2;
    switch(mQuickReturnAnimationType) {
        case TRANSLATION_SIMPLE:
            scrollListener = new QuickReturnListViewOnScrollListener.Builder(QuickReturnViewType.FOOTER).footer(mQuickReturnTextView).minFooterTranslation(footerHeight).build();
            mListView.setOnScrollListener(scrollListener);
            break;
        case TRANSLATION_SNAP:
            scrollListener = new QuickReturnListViewOnScrollListener.Builder(QuickReturnViewType.FOOTER).footer(mQuickReturnTextView).minFooterTranslation(footerHeight).isSnappable(true).build();
            mListView.setOnScrollListener(scrollListener);
            break;
        case TRANSLATION_ANTICIPATE_OVERSHOOT:
            scrollListener2 = new SpeedyQuickReturnListViewOnScrollListener.Builder(getActivity(), QuickReturnViewType.FOOTER).footer(mQuickReturnTextView).build();
            mListView.setOnScrollListener(scrollListener2);
            break;
        default:
            scrollListener = new QuickReturnListViewOnScrollListener.Builder(QuickReturnViewType.FOOTER).footer(mQuickReturnTextView).minFooterTranslation(footerHeight).build();
            mListView.setOnScrollListener(scrollListener);
            break;
    }
}
Also used : SpeedyQuickReturnListViewOnScrollListener(com.etiennelawlor.quickreturn.library.listeners.SpeedyQuickReturnListViewOnScrollListener) QuickReturnListViewOnScrollListener(com.etiennelawlor.quickreturn.library.listeners.QuickReturnListViewOnScrollListener) SpeedyQuickReturnListViewOnScrollListener(com.etiennelawlor.quickreturn.library.listeners.SpeedyQuickReturnListViewOnScrollListener) ArrayAdapter(android.widget.ArrayAdapter)

Example 2 with QuickReturnListViewOnScrollListener

use of com.etiennelawlor.quickreturn.library.listeners.QuickReturnListViewOnScrollListener in project superCleanMaster by joyoyao.

the class BatterySavingActivity method onCreate.

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_battery_saving);
    getActionBar().setDisplayHomeAsUpEnabled(true);
    // applyKitKatTranslucency();
    mBatterySavingAdapter = new BatterySavingAdapter(mContext, mAppProcessInfos);
    mListView.setAdapter(mBatterySavingAdapter);
    bindService(new Intent(mContext, CoreService.class), mServiceConnection, Context.BIND_AUTO_CREATE);
    int footerHeight = mContext.getResources().getDimensionPixelSize(R.dimen.footer_height);
    mListView.setOnScrollListener(new QuickReturnListViewOnScrollListener(QuickReturnType.FOOTER, null, 0, bottom_lin, footerHeight));
    textCounter.setAutoFormat(false);
    textCounter.setFormatter(new DecimalFormatter());
    textCounter.setAutoStart(false);
    // the amount the number increments at each time interval
    textCounter.setIncrement(5f);
    // the time interval (ms) at which the text changes
    textCounter.setTimeInterval(50);
    mInterstitialAd = new InterstitialAd(this);
    mInterstitialAd.setAdUnitId("ca-app-pub-4369038195513432/2986510514");
    mInterstitialAd.loadAd(new AdRequest.Builder().build());
    setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT);
}
Also used : BatterySavingAdapter(com.balaganovrocks.yourmasterclean.adapter.BatterySavingAdapter) QuickReturnListViewOnScrollListener(com.etiennelawlor.quickreturn.library.listeners.QuickReturnListViewOnScrollListener) CoreService(com.balaganovrocks.yourmasterclean.service.CoreService) Intent(android.content.Intent) InterstitialAd(com.google.android.gms.ads.InterstitialAd) DecimalFormatter(com.balaganovrocks.yourmasterclean.widget.textcounter.formatters.DecimalFormatter)

Example 3 with QuickReturnListViewOnScrollListener

use of com.etiennelawlor.quickreturn.library.listeners.QuickReturnListViewOnScrollListener in project superCleanMaster by joyoyao.

the class MemoryCleanActivity method onCreate.

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_memory_clean);
    getActionBar().setDisplayHomeAsUpEnabled(true);
    // applyKitKatTranslucency();
    mClearMemoryAdapter = new ClearMemoryAdapter(mContext, mAppProcessInfos);
    mListView.setAdapter(mClearMemoryAdapter);
    bindService(new Intent(mContext, CoreService.class), mServiceConnection, Context.BIND_AUTO_CREATE);
    int footerHeight = mContext.getResources().getDimensionPixelSize(R.dimen.footer_height);
    mListView.setOnScrollListener(new QuickReturnListViewOnScrollListener(QuickReturnType.FOOTER, null, 0, bottom_lin, footerHeight));
    textCounter.setAutoFormat(false);
    textCounter.setFormatter(new DecimalFormatter());
    textCounter.setAutoStart(false);
    // the amount the number increments at each time interval
    textCounter.setIncrement(5f);
    // the time interval (ms) at which the text changes
    textCounter.setTimeInterval(50);
    mInterstitialAd = new InterstitialAd(this);
    mInterstitialAd.setAdUnitId("ca-app-pub-4369038195513432/2986510514");
    mInterstitialAd.loadAd(new AdRequest.Builder().build());
    setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT);
}
Also used : QuickReturnListViewOnScrollListener(com.etiennelawlor.quickreturn.library.listeners.QuickReturnListViewOnScrollListener) CoreService(com.balaganovrocks.yourmasterclean.service.CoreService) Intent(android.content.Intent) InterstitialAd(com.google.android.gms.ads.InterstitialAd) ClearMemoryAdapter(com.balaganovrocks.yourmasterclean.adapter.ClearMemoryAdapter) DecimalFormatter(com.balaganovrocks.yourmasterclean.widget.textcounter.formatters.DecimalFormatter)

Example 4 with QuickReturnListViewOnScrollListener

use of com.etiennelawlor.quickreturn.library.listeners.QuickReturnListViewOnScrollListener in project superCleanMaster by joyoyao.

the class MemoryCleanActivity method onCreate.

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_memory_clean);
    getActionBar().setDisplayHomeAsUpEnabled(true);
    //  applyKitKatTranslucency();
    mClearMemoryAdapter = new ClearMemoryAdapter(mContext, mAppProcessInfos);
    mListView.setAdapter(mClearMemoryAdapter);
    bindService(new Intent(mContext, CoreService.class), mServiceConnection, Context.BIND_AUTO_CREATE);
    int footerHeight = mContext.getResources().getDimensionPixelSize(R.dimen.footer_height);
    mListView.setOnScrollListener(new QuickReturnListViewOnScrollListener(QuickReturnType.FOOTER, null, 0, bottom_lin, footerHeight));
    textCounter.setAutoFormat(false);
    textCounter.setFormatter(new DecimalFormatter());
    textCounter.setAutoStart(false);
    // the amount the number increments at each time interval
    textCounter.setIncrement(5f);
    // the time interval (ms) at which the text changes
    textCounter.setTimeInterval(50);
}
Also used : QuickReturnListViewOnScrollListener(com.etiennelawlor.quickreturn.library.listeners.QuickReturnListViewOnScrollListener) CoreService(com.yzy.supercleanmaster.service.CoreService) Intent(android.content.Intent) ClearMemoryAdapter(com.yzy.supercleanmaster.adapter.ClearMemoryAdapter) DecimalFormatter(com.yzy.supercleanmaster.widget.textcounter.formatters.DecimalFormatter)

Example 5 with QuickReturnListViewOnScrollListener

use of com.etiennelawlor.quickreturn.library.listeners.QuickReturnListViewOnScrollListener in project superCleanMaster by joyoyao.

the class RubbishCleanActivity method onCreate.

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_rublish_clean);
    getActionBar().setDisplayHomeAsUpEnabled(true);
    //     applyKitKatTranslucency();
    //        StikkyHeaderBuilder.stickTo(mListView).setHeader(header)
    //                .minHeightHeaderPixel(0).build();
    res = getResources();
    int footerHeight = mContext.getResources().getDimensionPixelSize(R.dimen.footer_height);
    mListView.setEmptyView(mEmptyView);
    rublishMemoryAdapter = new RublishMemoryAdapter(mContext, mCacheListItem);
    mListView.setAdapter(rublishMemoryAdapter);
    mListView.setOnItemClickListener(rublishMemoryAdapter);
    mListView.setOnScrollListener(new QuickReturnListViewOnScrollListener(QuickReturnType.FOOTER, null, 0, bottom_lin, footerHeight));
    bindService(new Intent(mContext, CleanerService.class), mServiceConnection, Context.BIND_AUTO_CREATE);
}
Also used : QuickReturnListViewOnScrollListener(com.etiennelawlor.quickreturn.library.listeners.QuickReturnListViewOnScrollListener) RublishMemoryAdapter(com.yzy.supercleanmaster.adapter.RublishMemoryAdapter) Intent(android.content.Intent) CleanerService(com.yzy.supercleanmaster.service.CleanerService)

Aggregations

QuickReturnListViewOnScrollListener (com.etiennelawlor.quickreturn.library.listeners.QuickReturnListViewOnScrollListener)6 Intent (android.content.Intent)5 InterstitialAd (com.google.android.gms.ads.InterstitialAd)3 CoreService (com.balaganovrocks.yourmasterclean.service.CoreService)2 DecimalFormatter (com.balaganovrocks.yourmasterclean.widget.textcounter.formatters.DecimalFormatter)2 ArrayAdapter (android.widget.ArrayAdapter)1 BatterySavingAdapter (com.balaganovrocks.yourmasterclean.adapter.BatterySavingAdapter)1 ClearMemoryAdapter (com.balaganovrocks.yourmasterclean.adapter.ClearMemoryAdapter)1 RublishMemoryAdapter (com.balaganovrocks.yourmasterclean.adapter.RublishMemoryAdapter)1 CleanerService (com.balaganovrocks.yourmasterclean.service.CleanerService)1 SpeedyQuickReturnListViewOnScrollListener (com.etiennelawlor.quickreturn.library.listeners.SpeedyQuickReturnListViewOnScrollListener)1 ClearMemoryAdapter (com.yzy.supercleanmaster.adapter.ClearMemoryAdapter)1 RublishMemoryAdapter (com.yzy.supercleanmaster.adapter.RublishMemoryAdapter)1 CleanerService (com.yzy.supercleanmaster.service.CleanerService)1 CoreService (com.yzy.supercleanmaster.service.CoreService)1 DecimalFormatter (com.yzy.supercleanmaster.widget.textcounter.formatters.DecimalFormatter)1