Search in sources :

Example 1 with DecimalFormatter

use of com.balaganovrocks.yourmasterclean.widget.textcounter.formatters.DecimalFormatter 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 2 with DecimalFormatter

use of com.balaganovrocks.yourmasterclean.widget.textcounter.formatters.DecimalFormatter 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 3 with DecimalFormatter

use of com.balaganovrocks.yourmasterclean.widget.textcounter.formatters.DecimalFormatter in project superCleanMaster by joyoyao.

the class RubbishCleanActivity method onScanCompleted.

@Override
public void onScanCompleted(Context context, List<CacheListItem> apps) {
    showProgressBar(false);
    mCacheListItem.clear();
    mCacheListItem.addAll(apps);
    rublishMemoryAdapter.notifyDataSetChanged();
    header.setVisibility(View.GONE);
    if (apps.size() > 0) {
        header.setVisibility(View.VISIBLE);
        bottom_lin.setVisibility(View.VISIBLE);
        long medMemory = mCleanerService != null ? mCleanerService.getCacheSize() : 0;
        StorageSize mStorageSize = StorageUtil.convertStorageSize(medMemory);
        textCounter.setAutoFormat(false);
        textCounter.setFormatter(new DecimalFormatter());
        textCounter.setAutoStart(false);
        textCounter.setStartValue(0f);
        textCounter.setEndValue(mStorageSize.value);
        // the amount the number increments at each time interval
        textCounter.setIncrement(5f);
        // the time interval (ms) at which the text changes
        textCounter.setTimeInterval(50);
        sufix.setText(mStorageSize.suffix);
        // textCounter.setSuffix(mStorageSize.suffix);
        textCounter.start();
    } else {
        header.setVisibility(View.GONE);
        bottom_lin.setVisibility(View.GONE);
    }
    if (!mAlreadyScanned) {
        mAlreadyScanned = true;
    }
}
Also used : StorageSize(com.balaganovrocks.yourmasterclean.model.StorageSize) DecimalFormatter(com.balaganovrocks.yourmasterclean.widget.textcounter.formatters.DecimalFormatter)

Aggregations

DecimalFormatter (com.balaganovrocks.yourmasterclean.widget.textcounter.formatters.DecimalFormatter)3 Intent (android.content.Intent)2 CoreService (com.balaganovrocks.yourmasterclean.service.CoreService)2 QuickReturnListViewOnScrollListener (com.etiennelawlor.quickreturn.library.listeners.QuickReturnListViewOnScrollListener)2 InterstitialAd (com.google.android.gms.ads.InterstitialAd)2 BatterySavingAdapter (com.balaganovrocks.yourmasterclean.adapter.BatterySavingAdapter)1 ClearMemoryAdapter (com.balaganovrocks.yourmasterclean.adapter.ClearMemoryAdapter)1 StorageSize (com.balaganovrocks.yourmasterclean.model.StorageSize)1