Beispiel #1
0
 @Override
 protected void onCreate(Bundle savedInstanceState) {
   super.onCreate(savedInstanceState);
   AppController.getController().getBus().register(this);
   manager = new GridLayoutManager(this, getResources().getInteger(R.integer.num_row));
   recycler.setItemAnimator(new DefaultItemAnimator());
   recycler.setHasFixedSize(true);
   recycler.setLayoutManager(manager);
   mDrawerLayout.setStatusBarBackgroundColor(
       AppHelper.getPrimaryDarkColor(AppHelper.getPrimaryColor(this)));
   navigationView.setItemIconTintList(ColorStateList.valueOf(AppHelper.getAccentColor(this)));
   if (AppHelper.isDarkTheme(this)) {
     navigationView.setItemTextColor(ColorStateList.valueOf(AppHelper.getAccentColor(this)));
   }
   adapter = new AppsAdapter(this, new ArrayList<AppsModel>());
   recycler.setAdapter(adapter);
   mDrawerLayout = (DrawerLayout) findViewById(R.id.drawer_layout);
   if (navigationView != null) {
     setupDrawerContent(navigationView);
   }
   getLoaderManager().restartLoader(0, null, this);
   productsList.addAll(Arrays.asList(getResources().getStringArray(R.array.in_app_billing)));
   mHelper = new IabHelper(this, getString(R.string.base64));
   mHelper.startSetup(mPurchaseFinishedListener);
   showWhatsNew();
   countBackup();
 }
Beispiel #2
0
 @Override
 protected void onDestroy() {
   if (AppController.getController().getBus().isRegistered(this)) {
     AppController.getController().getBus().unregister(this);
   }
   if (mHelper != null) mHelper.dispose();
   mHelper = null;
   super.onDestroy();
 }
Beispiel #3
0
  @Override
  public void onRequestPermissionsResult(
      int requestCode, @NonNull String[] permissions, @NonNull int[] grantResults) {
    if (requestCode == REQUEST_STORAGE) {
      if (verifyPermissions(grantResults)) {
        Snackbar.make(
                findViewById(R.id.toolbar),
                "Permission Granted, you may continue using" + " this function now.",
                Snackbar.LENGTH_LONG)
            .show();
      } else {
        Snackbar.make(
                findViewById(R.id.toolbar),
                "Permission Denied, you may not be able to " + "use this functionality",
                Snackbar.LENGTH_LONG)
            .show();
      }

    } else {
      super.onRequestPermissionsResult(requestCode, permissions, grantResults);
    }
  }
Beispiel #4
0
 @Override
 protected void onActivityResult(int requestCode, int resultCode, Intent data) {
   if (!mHelper.handleActivityResult(requestCode, resultCode, data)) {
     super.onActivityResult(requestCode, resultCode, data);
   }
 }