use of com.anjlab.android.iab.v3.BillingProcessor in project Phonograph by kabouzeid.
the class DonationsDialog method onCreateDialog.
@NonNull
@Override
public Dialog onCreateDialog(Bundle savedInstanceState) {
billingProcessor = new BillingProcessor(getContext(), App.GOOGLE_PLAY_LICENSE_KEY, this);
@SuppressLint("InflateParams") View customView = LayoutInflater.from(getContext()).inflate(R.layout.dialog_donation, null);
ProgressBar progressBar = ButterKnife.findById(customView, R.id.progress);
MDTintHelper.setTint(progressBar, ThemeSingleton.get().positiveColor.getDefaultColor());
return new MaterialDialog.Builder(getContext()).title(R.string.support_development).customView(customView, false).build();
}
use of com.anjlab.android.iab.v3.BillingProcessor in project Android-NotesApp by HelloPraveenIO.
the class ProActivity method onCreate.
@SuppressLint("SetTextI18n")
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_pro);
bp = new BillingProcessor(this, "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEApcobfuZFov1KIJgKEKrzp9PP2n1EbBpV/xf9AyhWYN47QY8/rWGPuKht/7b4DmCVnpd6PrnYJqLt/rqR5c+lifLY5XuUH1VGqnkWA33TkPXm4UkGk3q/jvVIbM5xbcdPLqNkLiEoEuBlmAYNxM6K3lf5Kz+ff1HUH1ljYjDE9M38xS0TiLnQIRPm9cfehNxaKWOF81sx5Q9K3vNB1JoNuMyaMfBFQjfMRL6llsMRF42NEf6W/4/2c5Guxvg2qLo14/gGVRLS5H0ZVwqThNZVYTtLRWWNIrgFIwMnCjcbntFkEBK/B987poGN6miDI2r1m6XALRAgLEzM/IUaPnwnWwIDAQAB", this);
bp.loadOwnedPurchasesFromGoogle();
TextView tv = findViewById(R.id.pro_head);
TextView tv2 = findViewById(R.id.pro_text);
Button b1 = findViewById(R.id.pro_upgrade);
Button b2 = findViewById(R.id.pro_redeem);
Button b3 = findViewById(R.id.pro_restore);
TextView tv3 = findViewById(R.id.pro_help);
preferences = PreferenceManager.getDefaultSharedPreferences(ProActivity.this);
int id = preferences.getInt("premium", 0);
if (id == 1) {
tv.setText("You're Premium!");
tv2.setText("Thanks for upgrading, you'll continue to receive premium features until your lifetime!");
b1.setVisibility(View.GONE);
b2.setVisibility(View.GONE);
b3.setVisibility(View.GONE);
LinearLayout temp = findViewById(R.id.pro_ll);
temp.setVisibility(View.GONE);
tv3.setText("For any queries,\nDon't hesitate to contact at\nhello@praveen.io or @HelloPraveenIO");
}
b1.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
bp.purchase(ProActivity.this, "notes_pro");
}
});
b3.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
bp.purchase(ProActivity.this, "notes_pro");
}
});
b2.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Uri redeemUri = Uri.parse("https://play.google.com/redeem");
Intent redeemIntent = new Intent(Intent.ACTION_VIEW, redeemUri);
startActivity(redeemIntent);
}
});
CalligraphyConfig.initDefault(new CalligraphyConfig.Builder().setDefaultFontPath("fonts/whitney.ttf").setFontAttrId(R.attr.fontPath).build());
Typeface font2 = Typeface.createFromAsset(getAssets(), "fonts/whitney.ttf");
SpannableStringBuilder SS = new SpannableStringBuilder("Premium");
SS.setSpan(new CustomTypefaceSpan("", font2), 0, SS.length(), Spanned.SPAN_EXCLUSIVE_INCLUSIVE);
if (getSupportActionBar() != null) {
getSupportActionBar().setTitle(SS);
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
}
}
use of com.anjlab.android.iab.v3.BillingProcessor in project Android-NotesApp by HelloPraveenIO.
the class AboutActivity method onCreate.
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_about);
bp = new BillingProcessor(this, "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEApcobfuZFov1KIJgKEKrzp9PP2n1EbBpV/xf9AyhWYN47QY8/rWGPuKht/7b4DmCVnpd6PrnYJqLt/rqR5c+lifLY5XuUH1VGqnkWA33TkPXm4UkGk3q/jvVIbM5xbcdPLqNkLiEoEuBlmAYNxM6K3lf5Kz+ff1HUH1ljYjDE9M38xS0TiLnQIRPm9cfehNxaKWOF81sx5Q9K3vNB1JoNuMyaMfBFQjfMRL6llsMRF42NEf6W/4/2c5Guxvg2qLo14/gGVRLS5H0ZVwqThNZVYTtLRWWNIrgFIwMnCjcbntFkEBK/B987poGN6miDI2r1m6XALRAgLEzM/IUaPnwnWwIDAQAB", this);
sv = findViewById(R.id.about_scroll);
CalligraphyConfig.initDefault(new CalligraphyConfig.Builder().setDefaultFontPath("fonts/whitney.ttf").setFontAttrId(R.attr.fontPath).build());
Typeface font2 = Typeface.createFromAsset(getAssets(), "fonts/whitney.ttf");
SpannableStringBuilder SS = new SpannableStringBuilder("About");
SS.setSpan(new CustomTypefaceSpan("", font2), 0, SS.length(), Spanned.SPAN_EXCLUSIVE_INCLUSIVE);
if (getSupportActionBar() != null) {
getSupportActionBar().setTitle(SS);
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
}
List<String> l = new ArrayList<>();
l.add("Project Contributors");
l.add("Tools & Licenses Used");
l.add("Donate and Support");
l.add("Rate the Application");
final RecyclerView recyclerView = findViewById(R.id.aboutRecyclerView);
AboutAdapter mAdapter = new AboutAdapter(l);
RecyclerView.LayoutManager mLayoutManager = new LinearLayoutManager(getApplicationContext());
recyclerView.setLayoutManager(mLayoutManager);
recyclerView.setItemAnimator(new DefaultItemAnimator());
recyclerView.addItemDecoration(new DividerItemDecoration(this, LinearLayoutManager.VERTICAL));
recyclerView.setAdapter(mAdapter);
recyclerView.addOnItemTouchListener(new RecyclerTouchListener(getApplicationContext(), new ClickListener() {
@Override
public void onClick(View view, final int position) {
if (position == 0) {
Intent i = new Intent(AboutActivity.this, ContributorsActivity.class);
startActivity(i);
} else if (position == 1) {
Intent i = new Intent(AboutActivity.this, LicensesActivity.class);
startActivity(i);
} else if (position == 2) {
bp.purchase(AboutActivity.this, "typenote_donate");
} else if (position == 3) {
startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse("market://details?id=io.praveen.typenote")));
}
}
}));
}
use of com.anjlab.android.iab.v3.BillingProcessor in project Timber by naman14.
the class DonateActivity method onCreate.
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_donate);
Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
setSupportActionBar(toolbar);
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
getSupportActionBar().setTitle("Support development");
action = getIntent().getAction();
productListView = (LinearLayout) findViewById(R.id.product_list);
progressBar = (ProgressBar) findViewById(R.id.progressBar);
status = (TextView) findViewById(R.id.donation_status);
if (action != null && action.equals("restore")) {
status.setText("Restoring purchases..");
}
bp = new BillingProcessor(this, getString(R.string.play_billing_license_key), this);
}
use of com.anjlab.android.iab.v3.BillingProcessor in project Phonograph by kabouzeid.
the class App method onCreate.
@Override
public void onCreate() {
super.onCreate();
app = this;
// default theme
if (!ThemeStore.isConfigured(this, 1)) {
ThemeStore.editTheme(this).activityTheme(R.style.Theme_Phonograph_Light).primaryColorRes(R.color.md_indigo_500).accentColorRes(R.color.md_pink_A400).commit();
}
// Set up Crashlytics, disabled for debug builds
Crashlytics crashlyticsKit = new Crashlytics.Builder().core(new CrashlyticsCore.Builder().disabled(BuildConfig.DEBUG).build()).build();
if (!BuildConfig.DEBUG) {
Fabric.with(this, crashlyticsKit, new Answers());
} else {
// crashlytics kit is disabled here
Fabric.with(this, crashlyticsKit);
}
// Set up dynamic shortcuts
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N_MR1) {
new DynamicShortcutManager(this).initDynamicShortcuts();
}
// automatically restores purchases
billingProcessor = new BillingProcessor(this, App.GOOGLE_PLAY_LICENSE_KEY, new BillingProcessor.IBillingHandler() {
@Override
public void onProductPurchased(String productId, TransactionDetails details) {
}
@Override
public void onPurchaseHistoryRestored() {
// Toast.makeText(App.this, R.string.restored_previous_purchase_please_restart, Toast.LENGTH_LONG).show();
}
@Override
public void onBillingError(int errorCode, Throwable error) {
}
@Override
public void onBillingInitialized() {
}
});
}
Aggregations