Android Open Source - PhotoStrips About Me Dialog Fragment






From Project

Back to project page PhotoStrips.

License

The source code is released under:

MIT License

If you think the Android project PhotoStrips 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.ahmetkizilay.image.photostrips.dialogs;
//  ww  w.j  av  a  2 s  .c o m
import com.ahmetkizilay.image.photostrips.R;
import com.ahmetkizilay.modules.donations.PaymentDialogFragment;
import com.ahmetkizilay.modules.donations.ThankYouDialogFragment;

import android.app.AlertDialog;
import android.app.Dialog;
import android.content.DialogInterface;
import android.content.Intent;
import android.content.pm.PackageManager;
import android.net.Uri;
import android.os.Bundle;
import android.support.v4.app.DialogFragment;
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentTransaction;

public class AboutMeDialogFragment extends DialogFragment{
  
  public static AboutMeDialogFragment newInstance() {
    AboutMeDialogFragment frag = new AboutMeDialogFragment();
    Bundle args = new Bundle();
    frag.setArguments(args);
    
    return frag;
  }
  
  public Dialog onCreateDialog(Bundle savedInstanceState) {

        PackageManager pm = getActivity().getPackageManager();
        String versionName = "1.0.0";
        try {
            versionName = pm.getPackageInfo(getActivity().getPackageName(), 0).versionName;
        } catch (Exception e) {}

    AlertDialog.Builder builder = new AlertDialog.Builder(getActivity());
    builder.setMessage(
        "Developed by Ahmet Kizilay\n\nThis is a free and open-sourced app. Please consider making a donation if you enjoy this app.\n\nPERISONiC Sound And Media")
        .setCancelable(false)
        .setTitle("PhotoStrips - v" + versionName)
        .setIcon(R.drawable.ic_photostrips)
        .setNeutralButton("DONATE", new DialogInterface.OnClickListener() {

          public void onClick(DialogInterface dialog, int which) {
            dialog.dismiss();
                        if(mCallback != null) {
                            mCallback.onDonationsRequested();
                        }
          }
        })
                .setPositiveButton("RATE ME", new DialogInterface.OnClickListener() {
                   public void onClick(DialogInterface dialog, int which) {

                       Intent rateIntent = new Intent(Intent.ACTION_VIEW, Uri.parse("market://details?id=" + getActivity().getPackageName()));
                       startActivity(rateIntent);
                   }
                });
    return builder.create();
  }

    private RequestListener mCallback;

    public void setRequestListener(RequestListener callback) {
        this.mCallback = callback;
    }

    public interface RequestListener {
        public void onDonationsRequested();
    }

}




Java Source Code List

com.ahmetkizilay.image.photostrips.AltGalleryActivity.java
com.ahmetkizilay.image.photostrips.CameraPreview.java
com.ahmetkizilay.image.photostrips.PhotoBoothActivity.java
com.ahmetkizilay.image.photostrips.PhotoCreator.java
com.ahmetkizilay.image.photostrips.ViewImageActivity.java
com.ahmetkizilay.image.photostrips.dialogs.AboutMeDialogFragment.java
com.ahmetkizilay.image.photostrips.dialogs.CompletionDialogFragment.java
com.ahmetkizilay.image.photostrips.dialogs.ConfirmDialogFragment.java
com.ahmetkizilay.image.photostrips.dialogs.PhotoCreationDialogFragment.java
com.ahmetkizilay.image.photostrips.utils.CustomHorizontalScrollView.java
com.ahmetkizilay.image.photostrips.utils.GalleryItemAdapter.java
com.ahmetkizilay.image.photostrips.utils.OnDoubleTapListener.java
com.ahmetkizilay.image.photostrips.utils.OnMultiTapListener.java
com.ahmetkizilay.image.photostrips.utils.TouchImageView.java
com.ahmetkizilay.image.photostrips.utils.TransportViewGroup.java