导航菜单

页面标题

页面副标题

Mantra Counter v25.01 - MainActivity.java 源代码

正在查看: Mantra Counter v25.01 应用的 MainActivity.java JAVA 源代码文件

本页面展示 JAVA 反编译生成的源代码文件,支持语法高亮显示。 仅供安全研究与技术分析使用,严禁用于任何非法用途。请遵守相关法律法规。


package com.sweetedge.mantracounter;

import alarmreminder.ReminderCreateDialog$7$;
import android.app.Activity;
import android.app.AlertDialog;
import android.app.Dialog;
import android.app.ProgressDialog;
import android.content.Context;
import android.content.DialogInterface;
import android.content.Intent;
import android.content.pm.PackageManager;
import android.content.res.AssetFileDescriptor;
import android.content.res.ColorStateList;
import android.content.res.Configuration;
import android.content.res.Resources;
import android.database.Cursor;
import android.graphics.Color;
import android.graphics.drawable.AnimationDrawable;
import android.graphics.drawable.Drawable;
import android.media.MediaPlayer;
import android.net.Uri;
import android.os.Build;
import android.os.Bundle;
import android.os.CountDownTimer;
import android.os.Environment;
import android.os.Handler;
import android.os.Vibrator;
import android.provider.DocumentsContract;
import android.provider.MediaStore;
import android.util.DisplayMetrics;
import android.util.Log;
import android.view.KeyEvent;
import android.view.LayoutInflater;
import android.view.MotionEvent;
import android.view.View;
import android.view.ViewGroup;
import android.view.animation.Animation;
import android.view.animation.AnimationUtils;
import android.widget.Button;
import android.widget.CompoundButton;
import android.widget.EditText;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.NumberPicker;
import android.widget.ProgressBar;
import android.widget.RadioButton;
import android.widget.RadioGroup;
import android.widget.RelativeLayout;
import android.widget.SeekBar;
import android.widget.Switch;
import android.widget.TextView;
import android.widget.VideoView;
import androidx.activity.OnBackPressedCallback;
import androidx.activity.result.ActivityResult;
import androidx.activity.result.ActivityResultCallback;
import androidx.activity.result.ActivityResultLauncher;
import androidx.activity.result.contract.ActivityResultContracts;
import androidx.appcompat.app.AppCompatActivity;
import androidx.appcompat.app.AppCompatDelegate;
import androidx.core.content.ContextCompat;
import androidx.drawerlayout.widget.DrawerLayout;
import com.android.volley.Response;
import com.android.volley.VolleyError;
import com.android.volley.toolbox.StringRequest;
import com.android.volley.toolbox.Volley;
import com.bumptech.glide.Glide;
import com.bumptech.glide.load.engine.DiskCacheStrategy;
import com.bumptech.glide.request.target.CustomTarget;
import com.bumptech.glide.request.transition.Transition;
import com.facebook.ads.AdSize;
import com.facebook.ads.AdView;
import com.google.android.gms.ads.AdRequest;
import com.google.android.gms.ads.LoadAdError;
import com.google.android.gms.ads.OnUserEarnedRewardListener;
import com.google.android.gms.ads.rewarded.RewardItem;
import com.google.android.gms.ads.rewarded.RewardedAd;
import com.google.android.gms.ads.rewarded.RewardedAdLoadCallback;
import com.google.android.gms.tasks.OnCompleteListener;
import com.google.android.gms.tasks.Task;
import com.google.android.material.snackbar.Snackbar;
import com.google.android.ump.ConsentForm;
import com.google.android.ump.ConsentInformation;
import com.google.android.ump.ConsentRequestParameters;
import com.google.android.ump.FormError;
import com.google.android.ump.UserMessagingPlatform;
import com.google.firebase.crashlytics.buildtools.ndk.internal.elf.EMachine;
import com.google.firebase.crashlytics.buildtools.reloc.org.apache.commons.cli.HelpFormatter;
import com.google.firebase.crashlytics.buildtools.reloc.org.apache.http.HttpHost;
import com.google.firebase.inappmessaging.FirebaseInAppMessaging;
import com.google.firebase.installations.FirebaseInstallations;
import com.google.firebase.messaging.FirebaseMessaging;
import com.google.logging.type.LogSeverity;
import com.makeramen.roundedimageview.RoundedDrawable;
import com.makeramen.roundedimageview.RoundedImageView;
import com.sweetedge.mantracounter.Authentication.Authentication;
import com.sweetedge.mantracounter.Authentication.UserDataPref;
import com.sweetedge.mantracounter.Authentication.UserWebService;
import com.sweetedge.mantracounter.Authentication.User_Screen;
import com.sweetedge.mantracounter.cashfree.NoAdsDialog;
import com.sweetedge.mantracounter.group.FallAnimation;
import com.sweetedge.mantracounter.group.GroupConst;
import com.sweetedge.mantracounter.group.GroupInfoPage;
import com.sweetedge.mantracounter.group.GroupWebService;
import com.sweetedge.mantracounter.group.LoadingDialog;
import com.sweetedge.mantracounter.group.MyGroup;
import com.sweetedge.mantracounter.group.PublicGroupInfoPage;
import com.sweetedge.mantracounter.list.Add_New_Mantra_List;
import com.sweetedge.mantracounter.list.ListIntro;
import com.sweetedge.mantracounter.list.MantraList;
import com.sweetedge.mantracounter.list.MantraListDb;
import com.sweetedge.mantracounter.list.UpdateDb;
import com.sweetedge.mantracounter.multimedia.GodImage;
import com.sweetedge.mantracounter.multimedia.GodVideo;
import com.sweetedge.mantracounter.multimedia.GodVideoDB;
import java.io.File;
import java.io.IOException;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import java.text.DecimalFormat;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Locale;
import java.util.Map;
import lecho.lib.hellocharts.model.Axis;
import lecho.lib.hellocharts.model.AxisValue;
import lecho.lib.hellocharts.model.Line;
import lecho.lib.hellocharts.model.LineChartData;
import lecho.lib.hellocharts.model.PointValue;
import lecho.lib.hellocharts.view.LineChartView;
import pl.droidsonroids.gif.GifImageView;
import push_notif.TokenClass;
import save_data.Const;
import save_data.iUtils;
import sub6.SubscriptionClass;
import sweetedge.calendar.PCalendar;
import sweetedge.decoration.PSetTypeface;
import sweetedge.default_package.PRateShareETC;
import sweetedge.extra.PLog;
import sweetedge.popup.PDialog;
import sweetedge.popup.PToast;
import sweetedge.preference.PSharedPreference;
import sweetedge.screen.PIntent;
import sweetedge.screen.PScreen;
import sweetedge.statusbar.PStatusBar;

public class MainActivity extends AppCompatActivity {
    public static long AppCounter = 0;
    public static boolean ISidMatch = true;
    public static String NotiClass = null;
    public static boolean PrimeChecked = false;
    public static String U_Gmail = null;
    static Animation closeTimerAnimation = null;
    public static long counter = 0;
    static Animation dark_mode_anim = null;
    static Animation fadein = null;
    static Animation fadeout = null;
    public static long graph_counter = 0;
    public static boolean isChooseFromGetMusicClass = false;
    static boolean isGroup = false;
    public static boolean isHighLightList = false;
    public static boolean isMusicGalleryClicked = false;
    public static boolean isStartAutoChanting = false;
    public static RoundedImageView photoLayoutImg;
    static Animation scaleTapIn;
    static Animation scaleTapout;
    public static long temp_count;
    public static long temp_graph_counter;
    static LinearLayout themeLayout;
    public static ImageView user_Img_Drawer;
    LinearLayout ActiveGroupLayout;
    LinearLayout ActiveListLayout;
    GifImageView AutoChanting;
    GifImageView AutoChanting_GodPooja;
    RelativeLayout Background;
    ImageView Bell;
    RelativeLayout BottomScreen;
    ImageView CloseTimer;
    ImageView Completed;
    ImageView FullscreenVideo;
    String GRPGodImg;
    String GRPID;
    String GRPName;
    ImageView GodPooja;
    RelativeLayout GodRelativeLayout;
    String GrpCreated;
    String GrpInfo;
    RelativeLayout LayoutPhotoandFrame;
    RelativeLayout Layout_Group;
    RelativeLayout Layout_List;
    LinearLayout Layout_multimedia_selection;
    RelativeLayout LeafHeapContainer;
    ImageView LightDarkIcon;
    TextView Longclickvideo;
    ImageView LoopVideo;
    ImageView MuteVideo;
    ImageView PauseVideo;
    ImageView PhotoModeIcon;
    RelativeLayout PhotoModeLayout;
    RelativeLayout PowerSaverLayoutforClick;
    ImageView PrimeTop;
    TextView ProgressText;
    Animation RHanging;
    Animation RHangingEnd;
    Animation RHangingStart;
    RelativeLayout SimpleModeGuide;
    ImageView SimpleModeReset;
    ImageView StopVideo;
    TextView ThemeTitle;
    long TimeinMillisecond;
    TextView Timer;
    ProgressBar TimerprogressBar1;
    LinearLayout VideoControlLayout;
    ImageView VideoModeIcon;
    RelativeLayout VideoModeLayout;
    String VideoURL;
    TextView activeListName;
    TextView active_Group_Name;
    AdView adFB;
    com.google.android.gms.ads.AdView ad_View;
    LinearLayout adviewContainer;
    Runnable autorunnable;
    ImageView closeDrawer;
    CountDownTimer count;
    LinearLayout counterLayout;
    TextView counterText;
    ImageView darkMode;
    ProgressDialog dialog;
    ImageView dismissBtn;
    TextView drawerAbout;
    TextView drawerMore;
    TextView drawerPrivacy;
    TextView drawerRate;
    TextView drawerShare;
    TextView drawer_Graph;
    TextView drawer_Group;
    TextView drawer_Group_desc;
    TextView drawer_Help;
    TextView drawer_ListTotal;
    TextView drawer_MantraList;
    TextView drawer_MantraList_desc;
    TextView drawer_Settings;
    TextView drawer_Theme;
    Switch drawer_photoModeSwitch;
    Switch drawer_simple;
    TextView drawer_simple_preview;
    ImageView extfileplay;
    RelativeLayout festivalPublicGroup;
    String file;
    ImageView flowerBtn;
    GifImageView gifPrime;
    DrawerLayout mDrawerLayout;
    View mSlidingView;
    ImageView mainLower;
    ImageView mainUpper;
    ImageView main_counter;
    ImageView main_reset;
    ImageView menuAboveTarget;
    ImageView menu_Powersaver;
    ImageView menuphoto;
    MediaPlayer mp1;
    MediaPlayer mp2;
    MediaPlayer mpbell;
    ImageView noadImg;
    LinearLayout numberLayoutforAnimation;
    TextView numbers;
    TextView numbers2;
    int option_tapId;
    File photoDir;
    ProgressBar progress_Bar;
    RelativeLayout progress_Layout;
    RelativeLayout rel_layout;
    RoundedImageView roundedImageView;
    int savedId;
    ImageView showControl;
    LinearLayout simpleModeSettingsLayout;
    SeekBar simpleModeTransparency;
    Snackbar snackbar_resetdone;
    TextView target;
    TextView tgt_rounds;
    ImageView themeBlue;
    ImageView themeDark;
    ImageView themeGolden;
    ImageView themeLavender;
    ImageView themeOrange;
    ImageView themeRed;
    RelativeLayout timerLayout;
    TextView total_Mantra_Drawer;
    Animation translateDown;
    Animation translateUp;
    TextView user_Name_Drawer;
    VideoView videoView;
    RelativeLayout wall1;
    RelativeLayout wall2;
    RelativeLayout wall3;
    RelativeLayout wall4;
    RelativeLayout wall5;
    RelativeLayout wall6;
    RelativeLayout whiteframeLayout;
    boolean isDefaultMediaSound = false;
    final Handler autohandler = new Handler();
    boolean isNetwork = false;
    boolean innerPauseMediaPlayer = false;
    boolean isMute = false;
    DecimalFormat df_big = new DecimalFormat("0000");
    DecimalFormat df_inr = new DecimalFormat("##,##,##,##,###");
    DecimalFormat df_photo = new DecimalFormat("0000");
    DecimalFormat df_small = new DecimalFormat("0000");
    DecimalFormat df_target_round = new DecimalFormat("000");
    DecimalFormat df_Count = new DecimalFormat("00");
    boolean isvib = true;
    boolean isSound = true;
    boolean isShow = true;
    boolean isCompletedAnimation = true;
    int themeid = 1;
    boolean innerPauseforLoadGroup = false;
    public MediaPlayer bgMediaPlayer = new MediaPlayer();
    boolean isPhotomode = true;
    boolean isVideomode = false;
    boolean isCompletedGroup = false;
    String GRPTarget = "0";
    String GRPTheme = "0";
    String GrpMyjapa = "0";
    boolean isPrepare = false;
    boolean isCompleted = false;
    ActivityResultLauncher<Intent> someActivityResultLauncher = registerForActivityResult(new ActivityResultContracts.StartActivityForResult(), new ActivityResultCallback<ActivityResult>() {
        public void onActivityResult(ActivityResult activityResult) {
            Intent data;
            if (activityResult.getResultCode() != -1 || (data = activityResult.getData()) == null || data.getData() == null) {
                return;
            }
            MainActivity.this.GetReadyMusicPlayer(String.valueOf(data.getData()), true, true);
        }
    });
    boolean isControlVisible = false;
    boolean PowerSaverMode = false;
    long currentTimeMilli = 0;
    AlertDialog alertMusic = null;
    boolean isloop = true;
    ActivityResultLauncher<String> LauncherNotification = registerForActivityResult(new ActivityResultContracts.RequestPermission(), new ActivityResultCallback<Boolean>() {
        public void onActivityResult(Boolean bool) {
            if (bool.booleanValue()) {
                return;
            }
            DialogInterface.OnClickListener onClickListener = new DialogInterface.OnClickListener() {
                @Override
                public void onClick(DialogInterface dialogInterface, int i) {
                    if (i == -1) {
                        Intent intent = new Intent("android.settings.APPLICATION_DETAILS_SETTINGS");
                        intent.setData(Uri.fromParts("package", MainActivity.this.getPackageName(), null));
                        MainActivity.this.startActivity(intent);
                    }
                }
            };
            ?? r0 = MainActivity.this;
            PDialog.showSimple((Context) r0, onClickListener, "Permission is Denied", "Allow Notification permission from Settings to Post Notification", r0.getResources().getString(R.string.Yes), MainActivity.this.getResources().getString(R.string.later));
        }
    });
    ActivityResultLauncher<String> LauncherMusic = registerForActivityResult(new ActivityResultContracts.RequestPermission(), new ActivityResultCallback<Boolean>() {
        public void onActivityResult(Boolean bool) {
            if (bool.booleanValue()) {
                return;
            }
            DialogInterface.OnClickListener onClickListener = new DialogInterface.OnClickListener() {
                @Override
                public void onClick(DialogInterface dialogInterface, int i) {
                    if (i == -1) {
                        Intent intent = new Intent("android.settings.APPLICATION_DETAILS_SETTINGS");
                        intent.setData(Uri.fromParts("package", MainActivity.this.getPackageName(), null));
                        MainActivity.this.startActivity(intent);
                    }
                }
            };
            ?? r0 = MainActivity.this;
            PDialog.showSimple((Context) r0, onClickListener, "Audio Permission is Denied", "Allow Audio permission from Settings to Record and Play Audio of Mantra.", r0.getResources().getString(R.string.Yes), MainActivity.this.getResources().getString(R.string.later));
        }
    });

    public void showLoading() {
        ProgressDialog progressDialog = new ProgressDialog(this);
        this.dialog = progressDialog;
        progressDialog.setMessage(getResources().getString(R.string.videoisstarting));
        this.dialog.show();
    }

    public void hideLoading() {
        ProgressDialog progressDialog = this.dialog;
        if (progressDialog == null || !progressDialog.isShowing()) {
            return;
        }
        this.dialog.dismiss();
    }

    public void onDestroy() {
        MediaPlayer mediaPlayer = this.mp1;
        if (mediaPlayer != null) {
            mediaPlayer.release();
        }
        MediaPlayer mediaPlayer2 = this.mp2;
        if (mediaPlayer2 != null) {
            mediaPlayer2.release();
        }
        MediaPlayer mediaPlayer3 = this.mpbell;
        if (mediaPlayer3 != null) {
            mediaPlayer3.release();
        }
        FallAnimation.isHeapPerformed = false;
        super.onDestroy();
    }

    public static String getRealPathFromURI(Context context, Uri uri) {
        Uri uri2;
        if ("file".equalsIgnoreCase(uri.getScheme())) {
            return uri.getPath();
        }
        String str = null;
        if ("content".equalsIgnoreCase(uri.getScheme()) && DocumentsContract.isDocumentUri(context, uri)) {
            String documentId = DocumentsContract.getDocumentId(uri);
            if (uri.getAuthority().equalsIgnoreCase("com.android.externalstorage.documents")) {
                String[] split = documentId.split(":");
                if ("primary".equalsIgnoreCase(split[0])) {
                    str = Environment.getExternalStorageDirectory() + "/" + split[1];
                }
            } else if (uri.getAuthority().equalsIgnoreCase("com.android.providers.media.documents")) {
                String[] split2 = documentId.split(":");
                String str2 = split2[0];
                if ("image".equalsIgnoreCase(str2)) {
                    uri2 = MediaStore.Images.Media.EXTERNAL_CONTENT_URI;
                } else if (GodVideoDB.Video.equalsIgnoreCase(str2)) {
                    uri2 = MediaStore.Video.Media.EXTERNAL_CONTENT_URI;
                } else {
                    uri2 = "audio".equalsIgnoreCase(str2) ? MediaStore.Audio.Media.EXTERNAL_CONTENT_URI : null;
                }
                if (uri2 != null) {
                    return getDataColumn(context, uri2, "_id=?", new String[]{split2[1]});
                }
            }
        }
        return str;
    }

    private static java.lang.String getDataColumn(android.content.Context r8, android.net.Uri r9, java.lang.String r10, java.lang.String[] r11) {
        throw new UnsupportedOperationException("Method not decompiled: com.sweetedge.mantracounter.MainActivity.getDataColumn(android.content.Context, android.net.Uri, java.lang.String, java.lang.String[]):java.lang.String");
    }

    public void GetReadyMusicPlayer(String str, final boolean z, boolean z2) {
        try {
            if (this.bgMediaPlayer == null) {
                this.bgMediaPlayer = new MediaPlayer();
            }
            MediaPlayer mediaPlayer = this.bgMediaPlayer;
            if (mediaPlayer != null) {
                mediaPlayer.reset();
                this.bgMediaPlayer.setDataSource(getApplicationContext(), Uri.parse(str));
                this.bgMediaPlayer.setLooping(true);
                this.bgMediaPlayer.setOnPreparedListener(new MediaPlayer.OnPreparedListener() {
                    @Override
                    public void onPrepared(MediaPlayer mediaPlayer2) {
                        if (z) {
                            MainActivity.this.bgMediaPlayer.start();
                            MainActivity.this.extfileplay.startAnimation(AnimationUtils.loadAnimation(MainActivity.this, R.anim.blink));
                        }
                    }
                });
                this.bgMediaPlayer.setOnCompletionListener(new MediaPlayer.OnCompletionListener() {
                    @Override
                    public void onCompletion(MediaPlayer mediaPlayer2) {
                        MainActivity.this.extfileplay.clearAnimation();
                    }
                });
                this.bgMediaPlayer.prepareAsync();
            }
            if (z2) {
                MusicDatabase musicDatabase = new MusicDatabase(this);
                musicDatabase.open();
                String realPathFromURI = getRealPathFromURI(this, Uri.parse(str));
                if (realPathFromURI != null) {
                    PSharedPreference.setString(this, "MUSIC_FILE", realPathFromURI);
                    musicDatabase.insert_data(realPathFromURI);
                    musicDatabase.close();
                }
            }
        } catch (IOException e) {
            e.printStackTrace();
        } catch (IllegalArgumentException e2) {
            e2.printStackTrace();
        } catch (IllegalStateException e3) {
            e3.printStackTrace();
        } catch (SecurityException e4) {
            e4.printStackTrace();
        }
    }

    public void showAdLoadingDialog() {
        AlertDialog.Builder builder = new AlertDialog.Builder(this);
        setLanguage(this);
        builder.setTitle(getResources().getString(R.string.theme));
        builder.setMessage(getResources().getString(R.string.tosetthisthemeyouhavetoseevideo));
        builder.setPositiveButton(getResources().getString(R.string.Yes), new DialogInterface.OnClickListener() {
            @Override
            public void onClick(DialogInterface dialogInterface, int i) {
                MainActivity.this.LoadingVideoAd();
            }
        });
        builder.setNegativeButton(getResources().getString(R.string.No), new DialogInterface.OnClickListener() {
            @Override
            public void onClick(DialogInterface dialogInterface, int i) {
                dialogInterface.cancel();
            }
        });
        builder.create().show();
        themeLayout.startAnimation(fadeout);
    }

    public void LoadingVideoAd() {
        RewardedAd.load(this, getResources().getString(R.string.google_rew1), new AdRequest.Builder().build(), new RewardedAdLoadCallback() {
            public void onAdFailedToLoad(LoadAdError loadAdError) {
                PToast.showT(MainActivity.this, "Failed...!");
                MainActivity.this.hideLoading();
            }

            public void onAdLoaded(RewardedAd rewardedAd) {
                MainActivity.this.hideLoading();
                rewardedAd.show(MainActivity.this, new OnUserEarnedRewardListener() {
                    public void onUserEarnedReward(RewardItem rewardItem) {
                        MainActivity.this.counterLayout.startAnimation(MainActivity.this.translateDown);
                        MainActivity.this.numberLayoutforAnimation.startAnimation(MainActivity.this.translateDown);
                    }
                });
            }
        });
        showLoading();
    }

    protected void onStop() {
        super.onStop();
        if (PSharedPreference.getInteger(this, getResources().getStringArray(R.array.ProductID)[0], 0) != 1 && !UserWebService.Prime.equals("1") && PSharedPreference.getInteger(this, "THEMES", 1) == 4) {
            PSharedPreference.setInteger(this, "THEMES", 1);
        }
        VideoView videoView = this.videoView;
        if (videoView == null || !videoView.isPlaying()) {
            return;
        }
        this.videoView.pause();
    }

    public static void setLanguage(Activity activity) {
        Locale locale = new Locale(PSharedPreference.getString(activity, "Language", "en"));
        Locale.setDefault(locale);
        Resources resources = activity.getResources();
        Configuration configuration = resources.getConfiguration();
        configuration.setLocale(locale);
        resources.updateConfiguration(configuration, resources.getDisplayMetrics());
    }

    private void fetchByGroupID(final Context context, final String str) {
        LoadingDialog.showD(this);
        Volley.newRequestQueue(context).add(new StringRequest(1, GroupConst.groupInfobyGID, new AnonymousClass6(context), new Response.ErrorListener() {
            public void onErrorResponse(VolleyError volleyError) {
                PToast.showT(context, "The server is down, Please try after some time!");
                LoadingDialog.hideD();
                PLog.print("Response Error" + volleyError + " = " + volleyError.getMessage());
            }
        }) {
            protected Map<String, String> getParams() {
                HashMap hashMap = new HashMap();
                hashMap.put("U_gmail", MainActivity.U_Gmail);
                hashMap.put("isPublic", String.valueOf(PSharedPreference.getBoolean(MainActivity.this, GroupConst.isPublic, false)));
                hashMap.put("GroupID", str);
                return hashMap;
            }
        });
    }

    class AnonymousClass6 implements Response.Listener<String> {
        final Context val$c;

        AnonymousClass6(Context context) {
            this.val$c = context;
        }

        public void onResponse(java.lang.String r35) {
            throw new UnsupportedOperationException("Method not decompiled: com.sweetedge.mantracounter.MainActivity.AnonymousClass6.onResponse(java.lang.String):void");
        }

        class AnonymousClass8 extends CustomTarget<Drawable> {
            final String val$GImage;
            final String val$GroupId;
            final String val$POOJA;

            public void onLoadCleared(Drawable drawable) {
            }

            AnonymousClass8(String str, String str2, String str3) {
                this.val$POOJA = str;
                this.val$GImage = str2;
                this.val$GroupId = str3;
            }

            public void onResourceReady(Object obj, Transition transition) {
                onResourceReady((Drawable) obj, (Transition<? super Drawable>) transition);
            }

            class AnonymousClass1 extends CustomTarget<Drawable> {
                public void onLoadCleared(Drawable drawable) {
                }

                AnonymousClass1() {
                }

                public void onResourceReady(Object obj, Transition transition) {
                    onResourceReady((Drawable) obj, (Transition<? super Drawable>) transition);
                }

                public void onResourceReady(final Drawable drawable, Transition<? super Drawable> transition) {
                    MainActivity.this.flowerBtn.setImageDrawable(drawable);
                    MainActivity.this.GodPooja.setImageDrawable(drawable);
                    Glide.with(MainActivity.this).load(AnonymousClass8.this.val$GImage).centerCrop().placeholder(R.drawable.group_inactive).into(new CustomTarget<Drawable>() {
                        public void onLoadCleared(Drawable drawable2) {
                        }

                        public void onResourceReady(Object obj, Transition transition2) {
                            onResourceReady((Drawable) obj, (Transition<? super Drawable>) transition2);
                        }

                        public void onResourceReady(Drawable drawable2, Transition<? super Drawable> transition2) {
                            MainActivity.this.roundedImageView.setImageDrawable(drawable2);
                            if (PSharedPreference.getBoolean(MainActivity.this, "G" + AnonymousClass8.this.val$GroupId, true)) {
                                MainActivity.this.festivalPublicGroup.setVisibility(0);
                                MainActivity.this.LeafHeapContainer.post(new Runnable() {
                                    @Override
                                    public void run() {
                                        FallAnimation.createLeafHeap(MainActivity.this, drawable, MainActivity.this.LeafHeapContainer);
                                    }
                                });
                            } else {
                                MainActivity.this.festivalPublicGroup.setVisibility(8);
                            }
                        }
                    });
                }
            }

            public void onResourceReady(Drawable drawable, Transition<? super Drawable> transition) {
                MainActivity.this.festivalPublicGroup.setBackground(drawable);
                Glide.with(MainActivity.this).load(this.val$POOJA).centerCrop().placeholder(R.drawable.group_inactive).into(new AnonymousClass1());
            }
        }
    }

    public void setActiveGroupDataLable(String str, boolean z) {
        this.ActiveGroupLayout.setVisibility(0);
        this.ActiveGroupLayout.startAnimation(AnimationUtils.loadAnimation(this, R.anim.scale_big_to_normal));
        this.active_Group_Name.setText(str);
        if (z) {
            this.Completed.setVisibility(0);
            this.Completed.startAnimation(AnimationUtils.loadAnimation(this, R.anim.scale_out_large));
        } else {
            this.Completed.setVisibility(8);
        }
    }

    private void SetMantraListUI() {
        MantraListDb mantraListDb = new MantraListDb(this);
        mantraListDb.open();
        Cursor all = mantraListDb.getAll();
        if (all.getCount() > 0) {
            this.drawer_ListTotal.setVisibility(0);
            this.drawer_ListTotal.setText(all.getCount() + "");
        } else {
            this.drawer_ListTotal.setVisibility(8);
        }
        Cursor mantraName = mantraListDb.getMantraName(UpdateDb.getID(this));
        if (mantraName != null) {
            if (mantraName.getCount() > 0) {
                if (mantraName.moveToFirst()) {
                    this.activeListName.setText(mantraName.getString(0));
                    this.activeListName.setVisibility(0);
                }
            } else {
                this.activeListName.setVisibility(8);
            }
        } else {
            this.activeListName.setVisibility(8);
        }
        mantraListDb.close();
    }

    public void setLocalJapa() {
        String string = PSharedPreference.getString(this, "Mantra", "Default");
        this.file = string;
        if (!string.equals("Default")) {
            try {
                MediaPlayer mediaPlayer = new MediaPlayer();
                this.mp1 = mediaPlayer;
                mediaPlayer.reset();
                if (this.file.endsWith(".mp3")) {
                    this.mp1.setDataSource(this.file);
                    this.isDefaultMediaSound = false;
                } else {
                    this.mp1.setDataSource(this.file);
                    this.isDefaultMediaSound = false;
                }
                this.isPrepare = false;
                this.mp1.prepare();
                this.mp1.setOnPreparedListener(new MediaPlayer.OnPreparedListener() {
                    @Override
                    public void onPrepared(MediaPlayer mediaPlayer2) {
                        MainActivity.this.isPrepare = true;
                        MainActivity.this.isCompleted = true;
                    }
                });
                this.mp1.setOnCompletionListener(new MediaPlayer.OnCompletionListener() {
                    @Override
                    public void onCompletion(MediaPlayer mediaPlayer2) {
                        MainActivity.this.isCompleted = true;
                    }
                });
            } catch (IOException | Exception unused) {
            }
        } else {
            MediaPlayer mediaPlayer2 = new MediaPlayer();
            this.mp1 = mediaPlayer2;
            mediaPlayer2.reset();
            AssetFileDescriptor openFd = getAssets().openFd("tik.mp3");
            this.mp1.setDataSource(openFd.getFileDescriptor(), openFd.getStartOffset(), openFd.getLength());
            this.isDefaultMediaSound = true;
            this.isPrepare = false;
            this.mp1.prepare();
            this.mp1.setOnPreparedListener(new MediaPlayer.OnPreparedListener() {
                @Override
                public void onPrepared(MediaPlayer mediaPlayer3) {
                    MainActivity.this.isPrepare = true;
                    MainActivity.this.isCompleted = true;
                }
            });
            this.mp1.setOnCompletionListener(new MediaPlayer.OnCompletionListener() {
                @Override
                public void onCompletion(MediaPlayer mediaPlayer3) {
                    MainActivity.this.isCompleted = true;
                }
            });
        }
        this.ActiveListLayout.setVisibility(0);
        this.ActiveGroupLayout.setVisibility(8);
        isGroup = false;
        PSharedPreference.setBoolean(this, GroupConst.isGroup, false);
        if (!PSharedPreference.getBoolean(this, "IS_Target_mode", true)) {
            this.whiteframeLayout.setVisibility(0);
            this.timerLayout.setVisibility(0);
        } else {
            canCelTimer();
            this.whiteframeLayout.setVisibility(0);
            this.timerLayout.setVisibility(4);
            this.tgt_rounds.setText(this.df_target_round.format(PSharedPreference.getLong(this, "ROUND", 0L)));
        }
        long j = PSharedPreference.getLong(this, "NUMBER", 0L);
        counter = j;
        this.numbers.setText(this.df_big.format(j));
        this.numbers2.setText(this.df_big.format(counter));
        long j2 = PSharedPreference.getLong(this, "TGT", 0L);
        if (j2 > 0) {
            LoadAdClass2.LoadIAd(this);
            this.target.setText(this.df_inr.format(j2));
            this.progress_Layout.setVisibility(0);
            changeProgressBar(this.progress_Bar, (int) ((counter * 100) / j2));
        } else {
            this.target.setText(getResources().getString(R.string.target_txt));
            this.progress_Layout.setVisibility(4);
        }
        if (PSharedPreference.getLong(this, "TGT", 0L) == 0) {
            this.rel_layout.setVisibility(8);
        } else {
            this.rel_layout.setVisibility(0);
        }
        this.tgt_rounds.setText(this.df_target_round.format(PSharedPreference.getLong(this, "ROUND", 0L)));
        checkforSimpleMode();
        setUpPhotoOrVideoMode(isGroup);
        switch (PSharedPreference.getInteger(this, "THEMES", 1)) {
            case 1:
                setRed(false);
                break;
            case 2:
                setBlue(false);
                break;
            case 3:
                setLavender(false);
                break;
            case 4:
                setDark(false);
                break;
            case 5:
                setOrange(false);
                break;
            case 6:
                setGolden(false);
                break;
        }
    }

    private void HighLightGroup() {
        openSlidingDrawer();
    }

    protected void onResume() {
        super.onResume();
        U_Gmail = PSharedPreference.getString(this, Const.GMAIL, "null");
        this.option_tapId = PSharedPreference.getInteger(this, "TAPID", 0);
        isGroup = PSharedPreference.getBoolean(this, GroupConst.isGroup, false);
        this.isPhotomode = PSharedPreference.getBoolean(this, "PHOTOMODE", true);
        this.isVideomode = PSharedPreference.getBoolean(this, "VIDEOMODE", false);
        this.GodPooja.setVisibility(8);
        if (this.isPhotomode) {
            if (PSharedPreference.getBoolean(this, "SHOW_GOD", true)) {
                PSharedPreference.setBoolean(this, "SHOW_GOD", false);
                ShowCase.showFeatureTutorialGod(this, photoLayoutImg, getResources().getString(R.string.godPhoto), getResources().getString(R.string.longClickToImage), "SHOW_IMG");
            } else if (PSharedPreference.getInteger(this, "Rate", 0) > 2 && PSharedPreference.getBoolean(this, "GODPOOJA", true) && this.GodPooja.getVisibility() == 0) {
                ShowCase.showFeaturePooja(this, this.GodPooja, getResources().getString(R.string.godPooja), getResources().getString(R.string.availableSoon), "GODPOOJA");
            }
        }
        try {
            String str = NotiClass;
            if (str != null) {
                if (str.length() > 2) {
                    TokenClass.updateStatusofPushNotif(this, U_Gmail);
                    if (NotiClass.startsWith(HttpHost.DEFAULT_SCHEME_NAME)) {
                        startActivity(new Intent("android.intent.action.VIEW", Uri.parse(NotiClass.trim())));
                    } else if (NotiClass.contains("User_Screen")) {
                        PIntent.goNewScreen(this, User_Screen.class);
                    } else if (NotiClass.contains("GodImage")) {
                        if (this.isPhotomode && !this.isVideomode && !isGroup) {
                            photoLayoutImg.performLongClick();
                        }
                    } else if (NotiClass.contains("GodVideo")) {
                        if (this.isPhotomode && this.isVideomode && !isGroup) {
                            this.videoView.performLongClick();
                        }
                    } else if (NotiClass.contains("GetMusic")) {
                        this.extfileplay.performClick();
                    } else if (NotiClass.contains("Theme")) {
                        closeSlidingDrawer();
                        themeLayout.startAnimation(fadein);
                    } else if (NotiClass.contains("Help")) {
                        PAds.helpClick(this);
                    } else if (NotiClass.contains("Group")) {
                        this.Layout_Group.performClick();
                    } else if (NotiClass.contains("Graph")) {
                        PIntent.goNewScreen(this, Graph.class);
                    } else if (NotiClass.contains("Reminder")) {
                        PIntent.goNewScreen(this, Settings.class);
                    } else if (NotiClass.contains("Adsfree")) {
                        this.noadImg.performClick();
                    }
                    NotiClass = null;
                }
                NotiClass = null;
            }
            if (!U_Gmail.equals("null")) {
                setUserDPandName(UserDataPref.get(this, "U_img").trim(), UserDataPref.get(this, "U_name").trim());
                PLog.print("Group is Here");
                if (PSharedPreference.getString(this, "U_group", "null").equalsIgnoreCase("NO")) {
                    PLog.print("Here Hide Group");
                    PSharedPreference.setBoolean(this, "isGroupHighlight", false);
                } else {
                    PLog.print("SHow Gruops");
                    this.Layout_Group.setVisibility(0);
                    if (!PSharedPreference.getBoolean(this, "isGroupHighlight", false)) {
                        HighLightGroup();
                    }
                }
            }
            graph_counter = PSharedPreference.getLong(this, "GRPH_COUNTER", 0L);
            this.extfileplay.setVisibility(0);
            this.isCompletedAnimation = true;
            if (!PSharedPreference.getBoolean(this, "BELL", true)) {
                this.Bell.setVisibility(8);
            } else {
                this.Bell.setVisibility(0);
            }
            if (PSharedPreference.getBoolean(this, "R_Daily", false)) {
                PSharedPreference.setBoolean(this, "R_Daily", false);
                isGroup = false;
            }
            if (this.innerPauseforLoadGroup) {
                this.innerPauseforLoadGroup = false;
            } else if (isGroup) {
                canCelTimer();
                this.whiteframeLayout.setVisibility(0);
                this.timerLayout.setVisibility(4);
                this.tgt_rounds.setText(this.df_target_round.format(0L));
                this.whiteframeLayout.setVisibility(0);
                this.timerLayout.setVisibility(4);
                fetchByGroupID(this, PSharedPreference.getString(this, GroupConst.Grpid, "null"));
                this.ActiveListLayout.setVisibility(8);
            } else {
                setLocalJapa();
            }
            setUpPhotoOrVideoMode(isGroup);
            if (isMusicGalleryClicked && PermissionClass.checkforAudioFile(this.LauncherMusic, this)) {
                isMusicGalleryClicked = false;
                this.extfileplay.clearAnimation();
                Intent intent = new Intent();
                intent.setAction("android.intent.action.GET_CONTENT");
                intent.setType("audio/mpeg");
                this.someActivityResultLauncher.launch(Intent.createChooser(intent, "Choose a Music File"));
            } else {
                String string = PSharedPreference.getString(this, "MUSIC_FILE", "null");
                if (!string.equals("null")) {
                    if (!isMediaPlayerPlaying()) {
                        if (this.innerPauseMediaPlayer) {
                            this.innerPauseMediaPlayer = false;
                            this.bgMediaPlayer.start();
                        } else if (isChooseFromGetMusicClass) {
                            GetReadyMusicPlayer(string, true, false);
                            isChooseFromGetMusicClass = false;
                        } else {
                            GetReadyMusicPlayer(string, false, false);
                        }
                    }
                } else {
                    this.extfileplay.clearAnimation();
                }
            }
            PSharedPreference.setLong(this, "MANTRAC", System.currentTimeMillis());
            this.isvib = PSharedPreference.getBoolean(this, "VIB", true);
            this.isSound = PSharedPreference.getBoolean(this, "SOUND", true);
            if (PSharedPreference.getInteger(this, getResources().getStringArray(R.array.ProductID)[0], 0) == 1 || UserWebService.Prime.equals("1")) {
                this.gifPrime.setVisibility(4);
                this.PrimeTop.setVisibility(0);
            } else {
                PSharedPreference.setInteger(this, "TAPID", 0);
                this.gifPrime.setVisibility(0);
                this.PrimeTop.setVisibility(8);
            }
            if (UserWebService.Prime.equals("1")) {
                this.adviewContainer.setVisibility(8);
            } else {
                new CountDownTimer(6000L, 1000L) {
                    @Override
                    public void onTick(long j) {
                    }

                    @Override
                    public void onFinish() {
                        if (!MainActivity.PrimeChecked && UserWebService.isNetworkAvailable(MainActivity.this)) {
                            UserWebService.fetchData(MainActivity.this, true, MainActivity.U_Gmail);
                        }
                        ?? r0 = MainActivity.this;
                        LoadAdClass1.LoadBanner(r0, r0.adviewContainer, MainActivity.this.ad_View, MainActivity.this.adFB);
                        ExitNativeAds.loadNativeAd(MainActivity.this);
                    }
                }.start();
            }
            if (isHighLightList) {
                openSlidingDrawer();
                this.Layout_List.startAnimation(AnimationUtils.loadAnimation(this, R.anim.scale_in));
                isHighLightList = false;
            }
        } catch (Exception e) {
            throw new RuntimeException(e);
        }
    }

    public void checkforSimpleMode() {
        boolean z = PSharedPreference.getBoolean(this, "POWERSAVER", false);
        this.PowerSaverMode = z;
        if (z) {
            this.simpleModeTransparency.setProgress(PSharedPreference.getInteger(this, "SIMPLE_TRANS", 100));
            this.numbers2.setAlpha(this.simpleModeTransparency.getProgress() / 100.0f);
            this.drawer_simple_preview.setAlpha((float) (this.numbers2.getAlpha() + 0.12d));
            this.menuphoto.setVisibility(0);
            this.menuAboveTarget.setVisibility(0);
            this.menu_Powersaver.setVisibility(0);
            this.PowerSaverLayoutforClick.setVisibility(0);
            this.LayoutPhotoandFrame.setVisibility(8);
            MakeFullScreenDark();
            return;
        }
        this.PowerSaverLayoutforClick.setVisibility(8);
        clearFullscreenDark();
    }

    void HideControlPowersaver() {
        if (this.isControlVisible) {
            this.isControlVisible = false;
            this.showControl.setVisibility(0);
            this.SimpleModeReset.setVisibility(4);
            this.progress_Layout.setVisibility(4);
            this.whiteframeLayout.setVisibility(4);
            this.menu_Powersaver.setVisibility(4);
        }
    }

    void showControlsPowersaver() {
        if (this.isControlVisible) {
            return;
        }
        this.isControlVisible = true;
        this.showControl.setVisibility(4);
        this.SimpleModeReset.setVisibility(0);
        if (PSharedPreference.getLong(this, "TGT", 0L) != 0) {
            this.progress_Layout.setVisibility(0);
        }
        this.whiteframeLayout.setVisibility(0);
        this.menu_Powersaver.setVisibility(0);
    }

    private void MakeFullScreenDark() {
        showControlsPowersaver();
        getWindow().getDecorView().setSystemUiVisibility(6);
    }

    private void clearFullscreenDark() {
        showControlsPowersaver();
        getWindow().clearFlags(1024);
    }

    public void setUpPhotoOrVideoMode(boolean z) {
        this.isPhotomode = PSharedPreference.getBoolean(this, "PHOTOMODE", true);
        this.isVideomode = PSharedPreference.getBoolean(this, "VIDEOMODE", false);
        this.drawer_photoModeSwitch.setChecked(this.isPhotomode);
        int width = PScreen.getWidth(this) + PScreen.getHeight(this);
        int i = width / 54;
        if (z) {
            PSharedPreference.setBoolean(this, "PHOTOMODE", true);
            PSharedPreference.setBoolean(this, "VIDEOMODE", false);
            this.isPhotomode = true;
            this.isVideomode = false;
            this.VideoModeIcon.setImageResource(R.drawable.video_mode_not);
            this.PhotoModeIcon.setImageResource(R.drawable.photo_mode);
        } else {
            SetMantraListUI();
            if (this.isVideomode && this.isPhotomode) {
                this.VideoModeIcon.setImageResource(R.drawable.video_mode);
                this.PhotoModeIcon.setImageResource(R.drawable.photo_mode_not);
                String string = PSharedPreference.getString(this, "IMG_VIDEO", "null");
                this.VideoURL = string;
                if (!string.equals("null")) {
                    PlayVideo(this.VideoURL);
                    UpdateDb.UpdateMantraMultiMedia(this, PSharedPreference.getBoolean(this, "PHOTOMODE", true), this.VideoURL);
                }
            } else if (this.isPhotomode) {
                String string2 = PSharedPreference.getString(this, "IMG_PHOTO", "Gallery");
                this.VideoModeIcon.setImageResource(R.drawable.video_mode_not);
                this.PhotoModeIcon.setImageResource(R.drawable.photo_mode);
                if (string2.equals("Gallery")) {
                    if (PSharedPreference.getLong(this, "NAME", 0L) > 8) {
                        String str = Environment.getExternalStorageDirectory() + "/Download/.MantraCounter/" + PSharedPreference.getLong(this, "NAME", 0L);
                        if (iUtils.checkFile(str)) {
                            UpdateDb.UpdateMantraMultiMedia(this, PSharedPreference.getBoolean(this, "PHOTOMODE", true), str);
                            photoLayoutImg.setImageResource(R.drawable.photodefault);
                            Glide.with(this).load(Uri.fromFile(new File(str))).diskCacheStrategy(DiskCacheStrategy.NONE).skipMemoryCache(true).into(photoLayoutImg);
                        } else {
                            photoLayoutImg.setImageResource(R.drawable.photodefault);
                        }
                    } else {
                        photoLayoutImg.setImageResource(R.drawable.photodefault);
                    }
                } else if (string2.startsWith("https")) {
                    UpdateDb.UpdateMantraMultiMedia(this, PSharedPreference.getBoolean(this, "PHOTOMODE", true), string2);
                    if (NetworkUtil.isInternetAvailable(this)) {
                        this.isNetwork = true;
                        Glide.with(this).load(string2).diskCacheStrategy(DiskCacheStrategy.ALL).skipMemoryCache(false).centerCrop().into(photoLayoutImg);
                    } else {
                        this.isNetwork = false;
                        Glide.with(this).load(Integer.valueOf(R.drawable.no_network)).centerCrop().into(photoLayoutImg);
                    }
                } else if (iUtils.checkFile(string2)) {
                    UpdateDb.UpdateMantraMultiMedia(this, PSharedPreference.getBoolean(this, "PHOTOMODE", true), string2);
                    photoLayoutImg.setImageResource(R.drawable.photodefault);
                    Glide.with(this).load(Uri.fromFile(new File(string2))).diskCacheStrategy(DiskCacheStrategy.NONE).skipMemoryCache(true).into(photoLayoutImg);
                } else {
                    photoLayoutImg.setImageResource(R.drawable.photodefault);
                }
            } else {
                this.Layout_multimedia_selection.setVisibility(8);
            }
        }
        boolean z2 = PSharedPreference.getBoolean(this, "POWERSAVER", false);
        this.PowerSaverMode = z2;
        if (z2) {
            this.LayoutPhotoandFrame.setVisibility(8);
            this.menuAboveTarget.setVisibility(0);
            this.menuphoto.setVisibility(8);
            this.menu_Powersaver.setVisibility(0);
            this.numbers.setText(this.df_big.format(counter));
            int i2 = width / 40;
            if (getResources().getConfiguration().orientation == 2) {
                this.numbers.setTextSize((float) (i / 1.95d));
            } else {
                this.numbers.setTextSize(i);
            }
            this.numbers2.setTextSize(i2);
            return;
        }
        if (this.isVideomode && this.isPhotomode) {
            if (this.LayoutPhotoandFrame.getVisibility() == 8) {
                this.LayoutPhotoandFrame.setVisibility(0);
            }
            this.PhotoModeLayout.setVisibility(8);
            this.VideoModeLayout.setVisibility(0);
            this.menuphoto.setVisibility(0);
            this.menuAboveTarget.setVisibility(8);
            this.menu_Powersaver.setVisibility(8);
            this.numbers.setText(this.df_photo.format(counter));
            if (getResources().getConfiguration().orientation == 2) {
                this.numbers.setTextSize((float) (i / 2.5d));
                return;
            } else {
                this.numbers.setTextSize((float) (i / 1.5d));
                return;
            }
        }
        if (this.isPhotomode || z) {
            if (this.LayoutPhotoandFrame.getVisibility() == 8) {
                this.LayoutPhotoandFrame.setVisibility(0);
            }
            this.VideoModeLayout.setVisibility(8);
            this.PhotoModeLayout.setVisibility(0);
            this.PhotoModeLayout.startAnimation(AnimationUtils.loadAnimation(this, R.anim.fadein));
            this.menuphoto.setVisibility(0);
            this.menuAboveTarget.setVisibility(8);
            this.menu_Powersaver.setVisibility(8);
            this.numbers.setText(this.df_photo.format(counter));
            if (getResources().getConfiguration().orientation == 2) {
                this.numbers.setTextSize((float) (i / 2.5d));
            } else {
                this.numbers.setTextSize((float) (i / 1.5d));
            }
            if (z) {
                Glide.with(this).load(PSharedPreference.getString(this, GroupConst.GrpgodImg, "null")).diskCacheStrategy(DiskCacheStrategy.ALL).into(photoLayoutImg);
                return;
            }
            return;
        }
        this.LayoutPhotoandFrame.setVisibility(8);
        this.menuAboveTarget.setVisibility(0);
        this.menuphoto.setVisibility(8);
        this.menu_Powersaver.setVisibility(8);
        this.numbers.setText(this.df_big.format(counter));
        int i3 = width / 40;
        if (getResources().getConfiguration().orientation == 2) {
            this.numbers.setTextSize((float) (i / 1.95d));
        } else {
            this.numbers.setTextSize(i);
        }
        this.numbers2.setTextSize(i3);
    }

    private void PlayVideo(String str) {
        this.videoView.setVisibility(0);
        this.videoView.setMediaController(null);
        this.Longclickvideo.setVisibility(8);
        this.videoView.setVideoURI(Uri.parse(str));
        this.videoView.setOnPreparedListener(new MediaPlayer.OnPreparedListener() {
            @Override
            public void onPrepared(final MediaPlayer mediaPlayer) {
                if (MainActivity.this.Longclickvideo.getVisibility() == 8 && MainActivity.this.isVideomode) {
                    MainActivity.this.videoView.start();
                    MainActivity.this.PauseVideo.setImageResource(R.drawable.pause_vdo);
                    Animation loadAnimation = AnimationUtils.loadAnimation(MainActivity.this, R.anim.photo_down);
                    loadAnimation.setAnimationListener(new Animation.AnimationListener() {
                        @Override
                        public void onAnimationRepeat(Animation animation) {
                        }

                        @Override
                        public void onAnimationStart(Animation animation) {
                        }

                        @Override
                        public void onAnimationEnd(Animation animation) {
                            MainActivity.this.VideoControlLayout.setVisibility(8);
                            MainActivity.this.VideoControlLayout.startAnimation(AnimationUtils.loadAnimation(MainActivity.this, R.anim.translate_down));
                            PSharedPreference.setBoolean(MainActivity.this, "isVideoFirst", false);
                        }
                    });
                    MainActivity.this.VideoControlLayout.setVisibility(0);
                    MainActivity.this.VideoControlLayout.startAnimation(loadAnimation);
                    MainActivity.this.MuteVideo.setOnClickListener(new View.OnClickListener() {
                        @Override
                        public void onClick(View view) {
                            if (!MainActivity.this.isMute) {
                                MainActivity.this.isMute = true;
                                mediaPlayer.setVolume(0.0f, 0.0f);
                                MainActivity.this.MuteVideo.setImageResource(R.drawable.sound_mute);
                            } else {
                                MainActivity.this.isMute = false;
                                mediaPlayer.setVolume(1.0f, 1.0f);
                                MainActivity.this.MuteVideo.setImageResource(R.drawable.sound);
                            }
                        }
                    });
                }
            }
        });
    }

    private void setUserDPandName(String str, String str2) {
        User_Screen.UserImageS = str;
        if (str.length() > 2) {
            Glide.with(this).load(str).diskCacheStrategy(DiskCacheStrategy.NONE).skipMemoryCache(true).into(new CustomTarget<Drawable>() {
                public void onLoadCleared(Drawable drawable) {
                }

                public void onResourceReady(Object obj, Transition transition) {
                    onResourceReady((Drawable) obj, (Transition<? super Drawable>) transition);
                }

                public void onResourceReady(Drawable drawable, Transition<? super Drawable> transition) {
                    if (drawable == null) {
                        return;
                    }
                    User_Screen.UserImg = drawable;
                    MainActivity.user_Img_Drawer.setImageDrawable(drawable);
                }
            });
        } else {
            user_Img_Drawer.setImageResource(R.drawable.error_in_group);
        }
        this.user_Name_Drawer.setText(str2);
    }

    public static String getTotalMantra(Context context) {
        Database database = new Database(context);
        database.open();
        Cursor all = database.getAll();
        return (all == null || !all.moveToLast()) ? "0" : all.getString(1);
    }

    private void canCelTimer() {
        CountDownTimer countDownTimer = this.count;
        if (countDownTimer != null) {
            countDownTimer.cancel();
        }
        this.CloseTimer.setVisibility(8);
        this.Timer.setText("Timer");
    }

    public void stopTimer() {
        this.TimerprogressBar1.setProgress(0);
        CountDownTimer countDownTimer = this.count;
        if (countDownTimer != null) {
            countDownTimer.cancel();
        }
        this.CloseTimer.setVisibility(8);
        setVib(500);
        TargetDialogClass targetDialogClass = new TargetDialogClass(this, false);
        targetDialogClass.setCancelable(false);
        targetDialogClass.show();
        this.Timer.setText("Timer");
    }

    protected void onPause() {
        super.onPause();
        if (!isGroup) {
            PSharedPreference.setLong(this, "NUMBER", counter);
            PSharedPreference.setLong(this, "GRPH_COUNTER", graph_counter);
        }
        StoreTotalonServer(AppCounter, Settings.getAppVersion(this));
        StoredataintoDatabase();
        UpdateDb.UpdateCounter(this, counter, PSharedPreference.getInteger(this, "THEMES", 1), PSharedPreference.getString(this, "Mantra", "Default"), PSharedPreference.getString(this, "MUSIC_FILE", "null").trim());
        if (isMediaPlayerPlaying()) {
            this.bgMediaPlayer.pause();
            this.extfileplay.clearAnimation();
        }
        isStartAutoChanting = false;
        stopAutoChanting();
    }

    public void StoredataintoDatabase() {
        if (isGroup) {
            GroupWebService.updateJapaCounteronServer(this, counter, Long.parseLong(this.GRPTarget), U_Gmail);
        }
        Database database = new Database(this);
        database.open();
        if (database.isExistMalaonThisDay(PCalendar.getDate() + HelpFormatter.DEFAULT_OPT_PREFIX + PCalendar.getMonth()) == 0) {
            Cursor all = database.getAll();
            if (all != null) {
                if (all.getCount() > PSharedPreference.getInteger(this, "DBROWS", 7)) {
                    database.deleteallGreaterthanNumbers(all.getCount() - PSharedPreference.getInteger(this, "DBROWS", 7));
                    database.insert_data(PCalendar.getDate() + HelpFormatter.DEFAULT_OPT_PREFIX + PCalendar.getMonth(), graph_counter, System.currentTimeMillis() + "");
                } else {
                    database.insert_data(PCalendar.getDate() + HelpFormatter.DEFAULT_OPT_PREFIX + PCalendar.getMonth(), graph_counter, System.currentTimeMillis() + "");
                }
            } else {
                database.insert_data(PCalendar.getDate() + HelpFormatter.DEFAULT_OPT_PREFIX + PCalendar.getMonth(), graph_counter, System.currentTimeMillis() + "");
            }
        } else {
            database.UpdateMala(PCalendar.getDate() + HelpFormatter.DEFAULT_OPT_PREFIX + PCalendar.getMonth(), graph_counter);
        }
        database.close();
    }

    public boolean onKeyDown(int i, KeyEvent keyEvent) {
        if (!this.PowerSaverMode) {
            if (i == 4) {
                if (this.mDrawerLayout.isOpen()) {
                    this.mDrawerLayout.close();
                    return true;
                }
                if (themeLayout.getVisibility() == 0) {
                    themeLayout.startAnimation(fadeout);
                    return true;
                }
                if (PAds.isDialogReady && !isGroup) {
                    PAds.showAppDialog();
                    PAds.isDialogReady = false;
                    return true;
                }
                if (this.bgMediaPlayer != null) {
                    if (isMediaPlayerPlaying()) {
                        this.extfileplay.clearAnimation();
                        this.bgMediaPlayer.stop();
                    }
                    this.bgMediaPlayer.release();
                    this.bgMediaPlayer = null;
                }
                ExitNativeAds.showExitDialog(this);
                return true;
            }
            return super.onKeyUp(i, keyEvent);
        }
        if (i == 25) {
            if (System.currentTimeMillis() - this.currentTimeMilli <= 500) {
                return true;
            }
            increaseCounter();
            this.currentTimeMilli = System.currentTimeMillis();
            return true;
        }
        if (i == 24) {
            if (System.currentTimeMillis() - this.currentTimeMilli <= 500) {
                return true;
            }
            increaseCounter();
            this.currentTimeMilli = System.currentTimeMillis();
            return true;
        }
        if (i == 4) {
            showControlsPowersaver();
            if (this.SimpleModeGuide.getVisibility() == 0) {
                this.SimpleModeGuide.setVisibility(8);
                return true;
            }
            if (this.mDrawerLayout.isOpen()) {
                this.mDrawerLayout.close();
                return true;
            }
            if (isMediaPlayerPlaying()) {
                this.extfileplay.clearAnimation();
                this.bgMediaPlayer.stop();
            }
            MediaPlayer mediaPlayer = this.bgMediaPlayer;
            if (mediaPlayer != null) {
                mediaPlayer.release();
            }
            this.bgMediaPlayer = null;
            ExitNativeAds.showExitDialog(this);
            return true;
        }
        return super.onKeyUp(i, keyEvent);
    }

    private void requestConsent() {
        ConsentRequestParameters build = new ConsentRequestParameters.Builder().setTagForUnderAgeOfConsent(false).build();
        final ConsentInformation consentInformation = UserMessagingPlatform.getConsentInformation(this);
        consentInformation.requestConsentInfoUpdate(this, build, new ConsentInformation.OnConsentInfoUpdateSuccessListener() {
            public void onConsentInfoUpdateSuccess() {
                if (consentInformation.getConsentStatus() == 2) {
                    if (consentInformation.isConsentFormAvailable()) {
                        MainActivity.this.loadConsentForm(consentInformation);
                        return;
                    }
                    return;
                }
                LoadAdClass1.isPersonallized = PSharedPreference.getBoolean(MainActivity.this, "Consent", true);
            }
        }, new ConsentInformation.OnConsentInfoUpdateFailureListener() {
            public void onConsentInfoUpdateFailure(FormError formError) {
                LoadAdClass1.isPersonallized = true;
            }
        });
    }

    public void loadConsentForm(final ConsentInformation consentInformation) {
        UserMessagingPlatform.loadConsentForm(this, new UserMessagingPlatform.OnConsentFormLoadSuccessListener() {
            public void onConsentFormLoadSuccess(ConsentForm consentForm) {
                consentForm.show(MainActivity.this, new ConsentForm.OnConsentFormDismissedListener() {
                    public void onConsentFormDismissed(FormError formError) {
                        if (formError != null) {
                            return;
                        }
                        boolean z = consentInformation.getConsentStatus() == 3;
                        PSharedPreference.setBoolean(MainActivity.this, "Consent", z);
                        LoadAdClass1.isPersonallized = z;
                    }
                });
            }
        }, new UserMessagingPlatform.OnConsentFormLoadFailureListener() {
            public void onConsentFormLoadFailure(FormError formError) {
                LoadAdClass1.isPersonallized = true;
            }
        });
    }

    protected void onCreate(Bundle bundle) {
        super.onCreate(bundle);
        setContentView(R.layout.activity_main);
        requestConsent();
        LoadAdClass1.isAdviewLoaded = false;
        FirebaseInAppMessaging.getInstance().setAutomaticDataCollectionEnabled(true);
        FirebaseMessaging.getInstance().setAutoInitEnabled(true);
        FirebaseInstallations.getInstance().getId().addOnCompleteListener(new OnCompleteListener<String>() {
            public void onComplete(Task<String> task) {
                if (task.isSuccessful()) {
                    PLog.print("Installation ID" + ((String) task.getResult()));
                    return;
                }
                Log.e("Installation ID", "Failed to retrieve Installation ID", task.getException());
            }
        });
        DrawerLayout findViewById = findViewById(R.id.mdrawer_layout);
        this.mDrawerLayout = findViewById;
        findViewById.setDrawerLockMode(1);
        this.mSlidingView = findViewById(R.id.slider);
        user_Img_Drawer = (ImageView) findViewById(R.id.user_img_drawer);
        this.user_Name_Drawer = (TextView) findViewById(R.id.user_name);
        this.noadImg = (ImageView) findViewById(R.id.noad_img);
        if (UserWebService.Prime.equals("1")) {
            this.noadImg.setVisibility(0);
        } else if (UserWebService.NO_AD_ENABLE.equals("1")) {
            this.noadImg.startAnimation(AnimationUtils.loadAnimation(this, R.anim.blink));
            this.noadImg.setVisibility(0);
        } else {
            this.noadImg.setVisibility(0);
        }
        this.simpleModeSettingsLayout = (LinearLayout) findViewById(R.id.simplemodeSettingsLayout);
        this.simpleModeTransparency = (SeekBar) findViewById(R.id.seekbar_transparency);
        this.drawer_simple_preview = (TextView) findViewById(R.id.simple_preview);
        DisplayMetrics displayMetrics = new DisplayMetrics();
        getWindowManager().getDefaultDisplay().getMetrics(displayMetrics);
        ViewGroup.LayoutParams layoutParams = (DrawerLayout.LayoutParams) this.mSlidingView.getLayoutParams();
        ((DrawerLayout.LayoutParams) layoutParams).width = displayMetrics.widthPixels;
        this.mSlidingView.setLayoutParams(layoutParams);
        PStatusBar.changeColor(getWindow(), Color.parseColor("#ff4141"));
        this.main_counter = (ImageView) findViewById(R.id.main_counter);
        this.main_reset = (ImageView) findViewById(R.id.main_reset);
        this.mainUpper = (ImageView) findViewById(R.id.mainUpper);
        this.mainLower = (ImageView) findViewById(R.id.mainLower);
        this.tgt_rounds = (TextView) findViewById(R.id.tgt_numbers);
        this.target = (TextView) findViewById(R.id.target);
        this.rel_layout = (RelativeLayout) findViewById(R.id.rel_layout);
        this.menuphoto = (ImageView) findViewById(R.id.menu_photo);
        this.menuAboveTarget = (ImageView) findViewById(R.id.menu_aboveTarget);
        this.menu_Powersaver = (ImageView) findViewById(R.id.menu_powersaver);
        this.ad_View = findViewById(R.id.ad_view);
        this.adFB = new AdView(this, getResources().getString(R.string.fb_banner), AdSize.BANNER_HEIGHT_50);
        this.adviewContainer = (LinearLayout) findViewById(R.id.ad_container);
        this.counterLayout = (LinearLayout) findViewById(R.id.counterLayout);
        this.numberLayoutforAnimation = (LinearLayout) findViewById(R.id.numberLayoutforAnimation);
        this.extfileplay = (ImageView) findViewById(R.id.extfileplay);
        photoLayoutImg = (RoundedImageView) findViewById(R.id.photo_layout_img);
        this.SimpleModeReset = (ImageView) findViewById(R.id.img_reset);
        this.BottomScreen = (RelativeLayout) findViewById(R.id.papaLayout);
        LinearLayout linearLayout = (LinearLayout) findViewById(R.id.controlLayout);
        this.VideoControlLayout = linearLayout;
        linearLayout.setVisibility(8);
        this.PauseVideo = (ImageView) findViewById(R.id.pause_vdo);
        this.StopVideo = (ImageView) findViewById(R.id.stop_vdo);
        this.FullscreenVideo = (ImageView) findViewById(R.id.fullscreen_vdo);
        this.LoopVideo = (ImageView) findViewById(R.id.loop_vdo);
        this.MuteVideo = (ImageView) findViewById(R.id.mute_vdo);
        this.Longclickvideo = (TextView) findViewById(R.id.longclickvideo);
        this.videoView = (VideoView) findViewById(R.id.video_view);
        this.Layout_multimedia_selection = (LinearLayout) findViewById(R.id.layout_multimedia_selection);
        this.PhotoModeIcon = (ImageView) findViewById(R.id.photoMode);
        this.VideoModeIcon = (ImageView) findViewById(R.id.videoMode);
        this.PhotoModeLayout = (RelativeLayout) findViewById(R.id.photomodelayout);
        this.VideoModeLayout = (RelativeLayout) findViewById(R.id.videomodelayout);
        this.LayoutPhotoandFrame = (RelativeLayout) findViewById(R.id.l);
        this.main_counter.setImageResource(R.drawable.black_btn_big);
        this.main_reset.setImageResource(R.drawable.black_btn_small);
        this.Background = (RelativeLayout) findViewById(R.id.background);
        this.darkMode = (ImageView) findViewById(R.id.darkmode);
        this.PrimeTop = (ImageView) findViewById(R.id.prime_top);
        this.darkMode.setVisibility(8);
        LinearLayout linearLayout2 = (LinearLayout) findViewById(R.id.activeGroupLayout);
        this.ActiveGroupLayout = linearLayout2;
        linearLayout2.setVisibility(8);
        this.ActiveListLayout = (LinearLayout) findViewById(R.id.activeListLayout);
        this.ActiveGroupLayout.setVisibility(8);
        this.activeListName = (TextView) findViewById(R.id.active_list_name);
        this.active_Group_Name = (TextView) findViewById(R.id.active_group_name);
        this.Completed = (ImageView) findViewById(R.id.complete_img);
        LoadAdClass1.init(this);
        this.gifPrime = findViewById(R.id.gifPrimeBtn);
        this.PowerSaverLayoutforClick = (RelativeLayout) findViewById(R.id.powersaver_Layout);
        this.progress_Bar = (ProgressBar) findViewById(R.id.progressbar);
        this.progress_Layout = (RelativeLayout) findViewById(R.id.progress_layout);
        this.whiteframeLayout = (RelativeLayout) findViewById(R.id.whiteframelayout);
        this.timerLayout = (RelativeLayout) findViewById(R.id.timer_layout);
        this.Timer = (TextView) findViewById(R.id.timer);
        ImageView imageView = (ImageView) findViewById(R.id.closeIcon);
        this.CloseTimer = imageView;
        imageView.setVisibility(8);
        this.Bell = (ImageView) findViewById(R.id.bell);
        this.GodPooja = (ImageView) findViewById(R.id.godPooja);
        this.RHangingStart = AnimationUtils.loadAnimation(this, R.anim.right_hanging_start);
        this.RHanging = AnimationUtils.loadAnimation(this, R.anim.right_hanging);
        this.RHangingEnd = AnimationUtils.loadAnimation(this, R.anim.right_hanging_end);
        this.TimerprogressBar1 = (ProgressBar) findViewById(R.id.progressBar1);
        PermissionClass.notifPermission(this, this.LauncherNotification);
        this.ProgressText = (TextView) findViewById(R.id.progressTxt);
        this.numbers = (TextView) findViewById(R.id.numbers);
        this.numbers2 = (TextView) findViewById(R.id.numbers2);
        ImageView imageView2 = (ImageView) findViewById(R.id.showControl);
        this.showControl = imageView2;
        imageView2.setVisibility(4);
        this.main_counter.setAlpha(0.0f);
        this.ThemeTitle = (TextView) findViewById(R.id.theme_title);
        this.AutoChanting = findViewById(R.id.AutoChanting);
        this.AutoChanting_GodPooja = findViewById(R.id.AutoChanting_GodPooja);
        if (PSharedPreference.getBoolean(this, "BELL", true)) {
            this.Bell.startAnimation(AnimationUtils.loadAnimation(this, R.anim.photo_up));
        }
        this.mpbell = new MediaPlayer();
        this.PrimeTop.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                if (MainActivity.this.isMediaPlayerPlaying()) {
                    MainActivity.this.innerPauseMediaPlayer = true;
                }
                PIntent.goNewScreen(MainActivity.this, NoAdsDialog.class);
            }
        });
        this.activeListName.setOnLongClickListener(new View.OnLongClickListener() {
            @Override
            public boolean onLongClick(View view) {
                PIntent.goNewScreen(MainActivity.this, MantraList.class);
                return true;
            }
        });
        if (PSharedPreference.getBoolean(this, "STARTUP", false)) {
            PIntent.goNewScreen(this, MantraList.class);
        }
        PSetTypeface.setTextView(this, this.ProgressText, "progress.otf");
        this.numbers.setText(this.df_big.format(counter));
        this.numbers2.setText(this.df_big.format(counter));
        this.main_reset.setPivotX(0.0f);
        this.main_reset.setPivotY(0.0f);
        this.main_reset.setScaleX(0.45f);
        this.main_reset.setScaleY(0.45f);
        this.main_reset.setAlpha(0.0f);
        boolean z = PSharedPreference.getBoolean(this, "POWERSAVER", false);
        this.PowerSaverMode = z;
        if (z) {
            this.PowerSaverLayoutforClick.setVisibility(0);
            getWindow().addFlags(1024);
            this.simpleModeSettingsLayout.setVisibility(0);
        } else {
            this.PowerSaverLayoutforClick.setVisibility(8);
            getWindow().clearFlags(1024);
            this.simpleModeSettingsLayout.setVisibility(8);
        }
        scaleTapIn = AnimationUtils.loadAnimation(this, R.anim.scale_in);
        scaleTapout = AnimationUtils.loadAnimation(this, R.anim.scale_out);
        this.gifPrime.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                MainActivity.this.innerPauseforLoadGroup = true;
                if (MainActivity.this.isMediaPlayerPlaying()) {
                    MainActivity.this.innerPauseMediaPlayer = true;
                }
                SubscriptionClass.subscribe(MainActivity.this);
            }
        });
        themeLayout = (LinearLayout) findViewById(R.id.themeLayout);
        this.themeRed = (ImageView) findViewById(R.id.themered);
        this.themeGolden = (ImageView) findViewById(R.id.themegolden);
        this.themeBlue = (ImageView) findViewById(R.id.themeblue);
        this.themeOrange = (ImageView) findViewById(R.id.themeorange);
        this.themeLavender = (ImageView) findViewById(R.id.themelavender);
        this.themeDark = (ImageView) findViewById(R.id.themedark);
        this.wall1 = (RelativeLayout) findViewById(R.id.w1);
        this.wall2 = (RelativeLayout) findViewById(R.id.w2);
        this.wall3 = (RelativeLayout) findViewById(R.id.w3);
        this.wall4 = (RelativeLayout) findViewById(R.id.w4);
        this.wall5 = (RelativeLayout) findViewById(R.id.w5);
        this.wall6 = (RelativeLayout) findViewById(R.id.w6);
        this.wall1.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                PSharedPreference.setInteger(MainActivity.this, "BACKGROUND_WALL", 1);
                MainActivity mainActivity = MainActivity.this;
                mainActivity.setBackground(mainActivity.Background, true);
            }
        });
        this.wall2.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                PSharedPreference.setInteger(MainActivity.this, "BACKGROUND_WALL", 2);
                MainActivity mainActivity = MainActivity.this;
                mainActivity.setBackground(mainActivity.Background, true);
            }
        });
        this.wall3.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                PSharedPreference.setInteger(MainActivity.this, "BACKGROUND_WALL", 3);
                MainActivity mainActivity = MainActivity.this;
                mainActivity.setBackground(mainActivity.Background, true);
            }
        });
        this.wall4.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                PSharedPreference.setInteger(MainActivity.this, "BACKGROUND_WALL", 4);
                MainActivity mainActivity = MainActivity.this;
                mainActivity.setBackground(mainActivity.Background, true);
            }
        });
        this.wall5.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                PSharedPreference.setInteger(MainActivity.this, "BACKGROUND_WALL", 5);
                MainActivity mainActivity = MainActivity.this;
                mainActivity.setBackground(mainActivity.Background, true);
            }
        });
        this.wall6.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                PSharedPreference.setInteger(MainActivity.this, "BACKGROUND_WALL", 6);
                MainActivity mainActivity = MainActivity.this;
                mainActivity.setBackground(mainActivity.Background, true);
            }
        });
        fadein = AnimationUtils.loadAnimation(this, R.anim.fadein);
        fadeout = AnimationUtils.loadAnimation(this, R.anim.fadeout);
        closeTimerAnimation = AnimationUtils.loadAnimation(this, R.anim.fadein);
        dark_mode_anim = AnimationUtils.loadAnimation(this, R.anim.dark_mode);
        this.closeDrawer = (ImageView) findViewById(R.id.close_drawer);
        this.LightDarkIcon = (ImageView) findViewById(R.id.light_dark_icon);
        this.drawer_MantraList = (TextView) findViewById(R.id.drawer_list);
        this.drawer_MantraList_desc = (TextView) findViewById(R.id.drawer_list_desc);
        this.drawer_ListTotal = (TextView) findViewById(R.id.totalList);
        this.drawer_Group_desc = (TextView) findViewById(R.id.drawer_group_desc);
        this.Layout_Group = (RelativeLayout) findViewById(R.id.drawer_groupLayout);
        this.Layout_List = (RelativeLayout) findViewById(R.id.drawer_listLayout);
        this.closeDrawer.setVisibility(4);
        this.drawer_Settings = (TextView) findViewById(R.id.drawer_settings);
        this.drawer_Graph = (TextView) findViewById(R.id.drawer_graphs);
        this.drawer_Help = (TextView) findViewById(R.id.drawer_help);
        this.drawer_Theme = (TextView) findViewById(R.id.drawer_theme);
        this.drawer_Group = (TextView) findViewById(R.id.drawer_group);
        this.drawerRate = (TextView) findViewById(R.id.drawer_rate);
        this.drawerShare = (TextView) findViewById(R.id.drawer_share);
        this.drawerAbout = (TextView) findViewById(R.id.drawer_abou);
        this.drawerPrivacy = (TextView) findViewById(R.id.drawer_privacy);
        this.drawerMore = (TextView) findViewById(R.id.drawer_more);
        Suggest.subject = "Suggestions !";
        new Suggest(this, (ImageView) findViewById(R.id.drawer_suggest_icon), false, "Write Suggestion to Us");
        this.drawer_photoModeSwitch = (Switch) findViewById(R.id.drawer_photomode);
        this.drawer_simple = (Switch) findViewById(R.id.drawer_simpleMode);
        this.total_Mantra_Drawer = (TextView) findViewById(R.id.total_mantra_drawer);
        this.drawer_Theme.setText(getResources().getString(R.string.theme));
        RelativeLayout relativeLayout = (RelativeLayout) findViewById(R.id.simpleModeGuide);
        this.SimpleModeGuide = relativeLayout;
        relativeLayout.setVisibility(8);
        this.drawer_simple.setChecked(PSharedPreference.getBoolean(this, "POWERSAVER", false));
        setLanguage(this);
        TextView textView = (TextView) findViewById(R.id.total_japa_title);
        ((TextView) findViewById(R.id.suggest)).setText(getResources().getString(R.string.suggestion));
        textView.setText(getResources().getString(R.string.total));
        this.drawer_photoModeSwitch.setText(getResources().getString(R.string.godPhoto));
        this.drawer_simple.setText(getResources().getString(R.string.simpleMode));
        this.drawer_Theme.setText(getResources().getString(R.string.theme));
        this.drawer_Graph.setText(getResources().getString(R.string.graph));
        this.drawer_Help.setText(getResources().getString(R.string.helptxt));
        this.drawer_Settings.setText(getResources().getString(R.string.setting));
        this.drawerRate.setText(getResources().getString(R.string.rate_5star));
        this.drawerShare.setText(getResources().getString(R.string.share));
        this.drawerAbout.setText(getResources().getString(R.string.About_App));
        this.drawerPrivacy.setText(getResources().getString(R.string.PrivacyPolicy));
        this.drawerMore.setText(getResources().getString(R.string.moreapps));
        this.target.setText(getResources().getString(R.string.target_txt));
        this.drawer_Group.setText(getResources().getString(R.string.group));
        this.drawer_Group_desc.setText(getResources().getString(R.string.creategroupDesc));
        this.drawer_MantraList.setText(getResources().getString(R.string.mantralist));
        this.drawer_MantraList_desc.setText(getResources().getString(R.string.mantra_list_desc));
        RelativeLayout relativeLayout2 = (RelativeLayout) findViewById(R.id.festivalPublicGroup);
        this.festivalPublicGroup = relativeLayout2;
        relativeLayout2.setVisibility(8);
        this.roundedImageView = (RoundedImageView) findViewById(R.id.roundedImageView);
        this.dismissBtn = (ImageView) findViewById(R.id.dismissBtn);
        this.flowerBtn = (ImageView) findViewById(R.id.flowerBtn);
        this.counterText = (TextView) findViewById(R.id.counterText);
        this.GodRelativeLayout = (RelativeLayout) findViewById(R.id.GodLinear);
        this.LeafHeapContainer = (RelativeLayout) findViewById(R.id.leafHeapContainer);
        PSetTypeface.setTextViewBulk(this, new TextView[]{this.numbers2, this.numbers, this.drawer_simple_preview, this.counterText}, "digital.ttf");
        this.dismissBtn.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                if (PSharedPreference.getBoolean(MainActivity.this, "G" + MainActivity.this.GRPID, true)) {
                    MainActivity.this.festivalPublicGroup.setVisibility(8);
                    PSharedPreference.setBoolean(MainActivity.this, "G" + MainActivity.this.GRPID, false);
                    return;
                }
                PSharedPreference.setBoolean(MainActivity.this, "G" + MainActivity.this.GRPID, true);
                MainActivity.this.festivalPublicGroup.setVisibility(0);
            }
        });
        this.festivalPublicGroup.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                MainActivity.this.flowerBtn.performClick();
            }
        });
        this.flowerBtn.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                MainActivity.this.increaseCounter();
                ?? r3 = MainActivity.this;
                FallAnimation.startLeafFall(r3, r3.flowerBtn.getDrawable(), MainActivity.this.GodRelativeLayout);
            }
        });
        this.Layout_List.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                if (MainActivity.isGroup) {
                    MainActivity.this.StopGroupChantingFeature();
                } else {
                    ?? r1 = MainActivity.this;
                    r1.gotoMantraListClass(r1);
                }
            }
        });
        this.Layout_List.setOnLongClickListener(new View.OnLongClickListener() {
            @Override
            public boolean onLongClick(View view) {
                PIntent.goNewScreen(MainActivity.this, ListIntro.class);
                return true;
            }
        });
        this.simpleModeTransparency.setOnSeekBarChangeListener(new SeekBar.OnSeekBarChangeListener() {
            @Override
            public void onStartTrackingTouch(SeekBar seekBar) {
            }

            @Override
            public void onStopTrackingTouch(SeekBar seekBar) {
            }

            @Override
            public void onProgressChanged(SeekBar seekBar, int i, boolean z2) {
                PSharedPreference.setInteger(MainActivity.this, "SIMPLE_TRANS", i);
                MainActivity.this.drawer_simple_preview.setAlpha((i + 12) / 100.0f);
            }
        });
        this.PhotoModeIcon.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                MainActivity.this.StopVideo.performClick();
                MainActivity.this.VideoModeIcon.setImageResource(R.drawable.video_mode_not);
                MainActivity.this.PhotoModeIcon.setImageResource(R.drawable.photo_mode);
                PSharedPreference.setBoolean(MainActivity.this, "PHOTOMODE", true);
                PSharedPreference.setBoolean(MainActivity.this, "VIDEOMODE", false);
            }
        });
        this.VideoModeIcon.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                if (MainActivity.isGroup) {
                    MainActivity.this.Layout_multimedia_selection.setVisibility(0);
                    MainActivity.this.VideoModeIcon.setImageResource(R.drawable.video_mode_not);
                    MainActivity.this.PhotoModeIcon.setImageResource(R.drawable.photo_mode);
                    MainActivity.this.StopGroupChantingFeature();
                    return;
                }
                MainActivity.this.VideoModeIcon.setImageResource(R.drawable.video_mode);
                MainActivity.this.PhotoModeIcon.setImageResource(R.drawable.photo_mode_not);
                PSharedPreference.setBoolean(MainActivity.this, "VIDEOMODE", true);
            }
        });
        this.videoView.setOnCompletionListener(new MediaPlayer.OnCompletionListener() {
            @Override
            public void onCompletion(MediaPlayer mediaPlayer) {
                MainActivity.this.videoView.start();
            }
        });
        this.videoView.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                if (MainActivity.this.Longclickvideo.getVisibility() == 8) {
                    if (MainActivity.this.VideoControlLayout.getVisibility() == 8) {
                        MainActivity.this.VideoControlLayout.setVisibility(0);
                        MainActivity.this.VideoControlLayout.startAnimation(AnimationUtils.loadAnimation(MainActivity.this, R.anim.photo_down));
                    } else {
                        MainActivity.this.VideoControlLayout.setVisibility(8);
                        MainActivity.this.VideoControlLayout.startAnimation(AnimationUtils.loadAnimation(MainActivity.this, R.anim.translate_down));
                    }
                }
            }
        });
        this.PauseVideo.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                if (MainActivity.this.videoView != null) {
                    if (MainActivity.this.videoView.isPlaying()) {
                        MainActivity.this.videoView.pause();
                        MainActivity.this.PauseVideo.setImageResource(R.drawable.play_video);
                    } else {
                        MainActivity.this.videoView.start();
                        MainActivity.this.PauseVideo.setImageResource(R.drawable.pause_vdo);
                    }
                }
            }
        });
        this.StopVideo.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                LoadAdClass1.showIAd(MainActivity.this);
                if (MainActivity.this.videoView != null) {
                    if (MainActivity.this.videoView.isPlaying()) {
                        MainActivity.this.videoView.stopPlayback();
                    }
                    MainActivity.this.videoView.setVisibility(8);
                    MainActivity.this.videoView.setVisibility(0);
                }
                PSharedPreference.setString(MainActivity.this, "IMG_VIDEO", "null");
                MainActivity.this.Longclickvideo.setVisibility(0);
                MainActivity.this.VideoControlLayout.setVisibility(8);
            }
        });
        this.FullscreenVideo.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                if (MainActivity.this.BottomScreen.getVisibility() == 0) {
                    MainActivity.this.BottomScreen.setVisibility(8);
                } else {
                    MainActivity.this.BottomScreen.setVisibility(0);
                }
            }
        });
        if (PSharedPreference.getBoolean(this, "LOOP_Video", true)) {
            this.LoopVideo.setImageResource(R.drawable.loop);
        } else {
            this.LoopVideo.setImageResource(R.drawable.no_loop);
        }
        this.LoopVideo.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                if (PSharedPreference.getBoolean(MainActivity.this, "LOOP_Video", true)) {
                    PSharedPreference.setBoolean(MainActivity.this, "LOOP_Video", false);
                    MainActivity.this.LoopVideo.setImageResource(R.drawable.no_loop);
                } else {
                    PSharedPreference.setBoolean(MainActivity.this, "LOOP_Video", true);
                    MainActivity.this.LoopVideo.setImageResource(R.drawable.loop);
                }
            }
        });
        this.SimpleModeGuide.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                MainActivity.this.SimpleModeGuide.setVisibility(8);
                MainActivity.this.closeSlidingDrawer();
            }
        });
        this.showControl.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                MainActivity.this.showControlsPowersaver();
            }
        });
        this.PowerSaverLayoutforClick.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                MainActivity.this.HideControlPowersaver();
                MainActivity.this.increaseCounter();
            }
        });
        this.ActiveGroupLayout.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                int integer = PSharedPreference.getInteger(MainActivity.this, "GRPLINKCLICKINFOCOUNTER", 1);
                if (integer >= 6) {
                    MainActivity.this.increaseCounter();
                    return;
                }
                ?? r2 = MainActivity.this;
                PToast.showT((Context) r2, r2.getResources().getString(R.string.longclicktogetinfo));
                PSharedPreference.setInteger(MainActivity.this, "GRPLINKCLICKINFOCOUNTER", integer + 1);
            }
        });
        this.ActiveGroupLayout.setOnLongClickListener(new View.OnLongClickListener() {
            @Override
            public boolean onLongClick(View view) {
                MainActivity.this.innerPauseforLoadGroup = false;
                if (PSharedPreference.getBoolean(MainActivity.this, GroupConst.isPublic, false)) {
                    if (MainActivity.this.isMediaPlayerPlaying()) {
                        MainActivity.this.innerPauseMediaPlayer = true;
                    }
                    PublicGroupInfoPage.GroupId = MainActivity.this.GRPID;
                    PublicGroupInfoPage.GroupName = MainActivity.this.GRPName;
                    PublicGroupInfoPage.GroupTarget = MainActivity.this.GRPTarget;
                    PublicGroupInfoPage.GroupImg = MainActivity.this.GRPGodImg;
                    PublicGroupInfoPage.GroupNote = MainActivity.this.GrpCreated;
                    PublicGroupInfoPage.GroupDesc = MainActivity.this.GrpInfo;
                    PIntent.goNewScreen(MainActivity.this, PublicGroupInfoPage.class);
                } else {
                    MyGroup.setGroupInfoData(MainActivity.this.GRPID, MainActivity.this.GRPTarget, MainActivity.this.GrpInfo, MainActivity.this.GRPName, MainActivity.photoLayoutImg.getDrawable(), MainActivity.this.GRPGodImg, MainActivity.this.GrpCreated);
                    if (MainActivity.this.isMediaPlayerPlaying()) {
                        MainActivity.this.innerPauseMediaPlayer = true;
                    }
                    PIntent.goNewScreen(MainActivity.this, GroupInfoPage.class);
                }
                return true;
            }
        });
        this.Layout_Group.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                if (UserDataPref.isLogin(MainActivity.this)) {
                    if (PSharedPreference.getInteger(MainActivity.this, "PERC", 0) > 80) {
                        MainActivity.this.mDrawerLayout.close();
                        if (MainActivity.this.isMediaPlayerPlaying()) {
                            MainActivity.this.innerPauseMediaPlayer = true;
                        }
                        PIntent.goNewScreen(MainActivity.this, MyGroup.class);
                        return;
                    }
                    DialogInterface.OnClickListener onClickListener = new DialogInterface.OnClickListener() {
                        @Override
                        public void onClick(DialogInterface dialogInterface, int i) {
                            if (i == -1) {
                                if (MainActivity.this.isMediaPlayerPlaying()) {
                                    MainActivity.this.innerPauseMediaPlayer = true;
                                }
                                PIntent.goNewScreen(MainActivity.this, User_Screen.class);
                            }
                        }
                    };
                    ?? r1 = MainActivity.this;
                    PDialog.showSimple((Context) r1, onClickListener, r1.getResources().getString(R.string.profile), MainActivity.this.getResources().getString(R.string.profile_complete), MainActivity.this.getResources().getString(R.string.Yes), MainActivity.this.getResources().getString(R.string.later));
                    return;
                }
                UserDataPref.noLogin(MainActivity.this);
            }
        });
        this.drawer_simple.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
            @Override
            public void onCheckedChanged(CompoundButton compoundButton, boolean z2) {
                if (MainActivity.this.drawer_simple.isChecked()) {
                    MainActivity.this.SimpleModeGuide.setVisibility(0);
                    PSharedPreference.setBoolean(MainActivity.this, "POWERSAVER", true);
                    MainActivity.this.simpleModeSettingsLayout.setVisibility(0);
                } else {
                    PSharedPreference.setBoolean(MainActivity.this, "POWERSAVER", false);
                    MainActivity.this.simpleModeSettingsLayout.setVisibility(8);
                }
            }
        });
        this.drawer_Settings.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                MainActivity.this.SettingMethod();
            }
        });
        this.drawer_Help.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                try {
                    PAds.helpClick(MainActivity.this);
                } catch (PackageManager.NameNotFoundException e) {
                    e.printStackTrace();
                }
            }
        });
        this.drawer_photoModeSwitch.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
            @Override
            public void onCheckedChanged(CompoundButton compoundButton, boolean z2) {
                if (MainActivity.isGroup) {
                    MainActivity.this.Layout_multimedia_selection.setVisibility(0);
                    MainActivity.this.drawer_photoModeSwitch.setChecked(PSharedPreference.getBoolean(MainActivity.this, "PHOTOMODE", true));
                } else if (MainActivity.this.drawer_photoModeSwitch.isChecked()) {
                    MainActivity.this.Layout_multimedia_selection.setVisibility(0);
                    PSharedPreference.setBoolean(MainActivity.this, "PHOTOMODE", true);
                    PSharedPreference.setBoolean(MainActivity.this, "VIDEOMODE", false);
                } else {
                    PSharedPreference.setBoolean(MainActivity.this, "PHOTOMODE", false);
                    PSharedPreference.setBoolean(MainActivity.this, "VIDEOMODE", false);
                    MainActivity.this.closeSlidingDrawer();
                }
            }
        });
        this.mDrawerLayout.addDrawerListener(new DrawerLayout.DrawerListener() {
            public void onDrawerSlide(View view, float f) {
            }

            public void onDrawerStateChanged(int i) {
            }

            public void onDrawerOpened(View view) {
                if (MainActivity.this.Layout_Group.getVisibility() == 0) {
                    ?? r5 = MainActivity.this;
                    ShowCase.showItemHelp(r5, r5.Layout_Group, MainActivity.this.getResources().getString(R.string.creategroupDesc), MainActivity.this.getResources().getString(R.string.completetargetIndi), "SHOW_GRP");
                }
                int i = MainActivity.this.getResources().getConfiguration().uiMode & 48;
                if (i == 32) {
                    MainActivity.this.LightDarkIcon.setImageResource(R.drawable.dark_mode);
                } else if (i == 16) {
                    MainActivity.this.LightDarkIcon.setImageResource(R.drawable.light);
                }
                PStatusBar.changeColor(MainActivity.this.getWindow(), ContextCompat.getColor(MainActivity.this, R.color.orangeFontColor));
                if (UserDataPref.isLogin(MainActivity.this)) {
                    MainActivity.this.total_Mantra_Drawer.setText(MainActivity.AppCounter + "");
                } else {
                    MainActivity.this.total_Mantra_Drawer.setText(MainActivity.graph_counter + "");
                }
                MainActivity.this.closeDrawer.setVisibility(0);
                MainActivity.this.closeDrawer.startAnimation(AnimationUtils.loadAnimation(MainActivity.this, R.anim.fadein));
                if (MainActivity.U_Gmail.equals("null") || PSharedPreference.getBoolean(MainActivity.this, "isGroupHighlight", false) || PSharedPreference.getString(MainActivity.this, "U_group", "null").equalsIgnoreCase("NO")) {
                    return;
                }
                PSharedPreference.setBoolean(MainActivity.this, "isGroupHighlight", true);
                MainActivity.this.Layout_Group.startAnimation(AnimationUtils.loadAnimation(MainActivity.this, R.anim.scale_in));
                MainActivity.this.Layout_Group.setVisibility(0);
            }

            public void onDrawerClosed(View view) {
                MainActivity.this.closeDrawer.setVisibility(4);
                MainActivity.this.checkforSimpleMode();
                MainActivity.this.setUpPhotoOrVideoMode(MainActivity.isGroup);
                int integer = PSharedPreference.getInteger(MainActivity.this, "THEMES", 1);
                if (integer == 1) {
                    PStatusBar.changeColor(MainActivity.this.getWindow(), ContextCompat.getColor(MainActivity.this, R.color.red));
                    return;
                }
                if (integer == 2) {
                    PStatusBar.changeColor(MainActivity.this.getWindow(), ContextCompat.getColor(MainActivity.this, R.color.blue));
                    return;
                }
                if (integer == 3) {
                    PStatusBar.changeColor(MainActivity.this.getWindow(), Color.parseColor("#54085f"));
                } else if (integer == 4) {
                    PStatusBar.changeColor(MainActivity.this.getWindow(), RoundedDrawable.DEFAULT_BORDER_COLOR);
                } else {
                    if (integer != 5) {
                        return;
                    }
                    PStatusBar.changeColor(MainActivity.this.getWindow(), ContextCompat.getColor(MainActivity.this, R.color.orangeFontColor));
                }
            }
        });
        this.user_Name_Drawer.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                MainActivity.user_Img_Drawer.performClick();
            }
        });
        user_Img_Drawer.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                if (!MainActivity.U_Gmail.equals("null")) {
                    if (MainActivity.this.isMediaPlayerPlaying()) {
                        MainActivity.this.innerPauseMediaPlayer = true;
                    }
                    PIntent.goNewScreen(MainActivity.this, User_Screen.class);
                    return;
                }
                MainActivity.ShowLoginDialog(MainActivity.this);
            }
        });
        this.noadImg.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                if (MainActivity.this.isMediaPlayerPlaying()) {
                    MainActivity.this.innerPauseMediaPlayer = true;
                }
                PIntent.goNewScreen(MainActivity.this, NoAdsDialog.class);
            }
        });
        this.drawerRate.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                PRateShareETC.rate(MainActivity.this);
            }
        });
        this.drawerPrivacy.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                Intent intent = new Intent("android.intent.action.VIEW");
                intent.setData(Uri.parse("https://policy.davdapranav.com/?d=davda"));
                MainActivity.this.startActivity(intent);
            }
        });
        this.drawerAbout.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                if (MainActivity.this.isMediaPlayerPlaying()) {
                    MainActivity.this.innerPauseMediaPlayer = true;
                }
                PIntent.goNewScreen(MainActivity.this, Developer_About.class);
            }
        });
        this.drawerShare.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                PRateShareETC.share(MainActivity.this, "Download Mantra Counter App from Google Play and Enjoy Handy Counter in Your Mobile");
            }
        });
        this.drawerMore.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                Intent intent = new Intent("android.intent.action.VIEW");
                intent.setData(Uri.parse("https://www.davdapranav.com"));
                MainActivity.this.startActivity(intent);
            }
        });
        closeTimerAnimation.setAnimationListener(new Animation.AnimationListener() {
            @Override
            public void onAnimationRepeat(Animation animation) {
            }

            @Override
            public void onAnimationStart(Animation animation) {
            }

            @Override
            public void onAnimationEnd(Animation animation) {
                MainActivity.this.CloseTimer.setVisibility(0);
            }
        });
        this.CloseTimer.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                MainActivity.this.TimerprogressBar1.setProgress(0);
                if (MainActivity.this.count != null) {
                    MainActivity.this.count.cancel();
                    MainActivity.this.CloseTimer.setVisibility(8);
                    MainActivity.this.Timer.setText("Timer");
                }
            }
        });
        dark_mode_anim.setAnimationListener(new Animation.AnimationListener() {
            @Override
            public void onAnimationRepeat(Animation animation) {
            }

            @Override
            public void onAnimationStart(Animation animation) {
                MainActivity.this.darkMode.setVisibility(0);
            }

            @Override
            public void onAnimationEnd(Animation animation) {
                MainActivity.this.darkMode.setVisibility(8);
                MainActivity.this.counterLayout.startAnimation(MainActivity.this.translateDown);
                MainActivity.this.numberLayoutforAnimation.startAnimation(MainActivity.this.translateDown);
            }
        });
        themeLayout.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                MainActivity.this.ThemeTitle.setText(MainActivity.this.getResources().getString(R.string.theme));
                MainActivity.themeLayout.startAnimation(MainActivity.fadeout);
            }
        });
        fadein.setAnimationListener(new Animation.AnimationListener() {
            @Override
            public void onAnimationRepeat(Animation animation) {
            }

            @Override
            public void onAnimationStart(Animation animation) {
            }

            @Override
            public void onAnimationEnd(Animation animation) {
                MainActivity.themeLayout.setVisibility(0);
            }
        });
        fadeout.setAnimationListener(new Animation.AnimationListener() {
            @Override
            public void onAnimationRepeat(Animation animation) {
            }

            @Override
            public void onAnimationStart(Animation animation) {
            }

            @Override
            public void onAnimationEnd(Animation animation) {
                MainActivity.themeLayout.setVisibility(4);
            }
        });
        this.timerLayout.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                MainActivity.this.showTimePicker();
            }
        });
        this.themeRed.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                MainActivity.this.themeid = 1;
                MainActivity.themeLayout.startAnimation(MainActivity.fadeout);
                MainActivity.this.counterLayout.startAnimation(MainActivity.this.translateDown);
                MainActivity.this.numberLayoutforAnimation.startAnimation(MainActivity.this.translateDown);
            }
        });
        this.themeBlue.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                MainActivity.this.themeid = 2;
                MainActivity.themeLayout.startAnimation(MainActivity.fadeout);
                MainActivity.this.counterLayout.startAnimation(MainActivity.this.translateDown);
                MainActivity.this.numberLayoutforAnimation.startAnimation(MainActivity.this.translateDown);
            }
        });
        this.themeLavender.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                MainActivity.this.themeid = 3;
                MainActivity.themeLayout.startAnimation(MainActivity.fadeout);
                MainActivity.this.counterLayout.startAnimation(MainActivity.this.translateDown);
                MainActivity.this.numberLayoutforAnimation.startAnimation(MainActivity.this.translateDown);
            }
        });
        this.themeDark.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                MainActivity.this.themeid = 4;
                ?? r3 = MainActivity.this;
                if (PSharedPreference.getInteger((Context) r3, r3.getResources().getStringArray(R.array.ProductID)[0], 0) == 1 || UserWebService.Prime.equals("1")) {
                    MainActivity.themeLayout.startAnimation(MainActivity.fadeout);
                    MainActivity.this.darkMode.startAnimation(MainActivity.dark_mode_anim);
                } else {
                    ?? r32 = MainActivity.this;
                    PToast.showT((Context) r32, r32.getResources().getString(R.string.notprime));
                    MainActivity.this.showAdLoadingDialog();
                }
            }
        });
        this.themeOrange.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                MainActivity.this.themeid = 5;
                ?? r3 = MainActivity.this;
                if (PSharedPreference.getInteger((Context) r3, r3.getResources().getStringArray(R.array.ProductID)[0], 0) == 1 || UserWebService.Prime.equals("1")) {
                    MainActivity.themeLayout.startAnimation(MainActivity.fadeout);
                    MainActivity.this.counterLayout.startAnimation(MainActivity.this.translateDown);
                    MainActivity.this.numberLayoutforAnimation.startAnimation(MainActivity.this.translateDown);
                } else {
                    ?? r32 = MainActivity.this;
                    PToast.showT((Context) r32, r32.getResources().getString(R.string.notprime));
                    MainActivity.this.showAdLoadingDialog();
                }
            }
        });
        this.themeGolden.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                MainActivity.this.themeid = 6;
                ?? r3 = MainActivity.this;
                if (PSharedPreference.getInteger((Context) r3, r3.getResources().getStringArray(R.array.ProductID)[0], 0) == 1 || UserWebService.Prime.equals("1")) {
                    MainActivity.themeLayout.startAnimation(MainActivity.fadeout);
                    MainActivity.this.counterLayout.startAnimation(MainActivity.this.translateDown);
                    MainActivity.this.numberLayoutforAnimation.startAnimation(MainActivity.this.translateDown);
                } else {
                    ?? r32 = MainActivity.this;
                    PToast.showT((Context) r32, r32.getResources().getString(R.string.notprime));
                    MainActivity.this.showAdLoadingDialog();
                }
            }
        });
        this.RHangingStart.setAnimationListener(new Animation.AnimationListener() {
            @Override
            public void onAnimationRepeat(Animation animation) {
            }

            @Override
            public void onAnimationStart(Animation animation) {
                MainActivity.this.isCompletedAnimation = false;
                MainActivity.this.playBell();
            }

            @Override
            public void onAnimationEnd(Animation animation) {
                MainActivity.this.Bell.startAnimation(MainActivity.this.RHanging);
            }
        });
        this.RHanging.setAnimationListener(new Animation.AnimationListener() {
            @Override
            public void onAnimationRepeat(Animation animation) {
            }

            @Override
            public void onAnimationStart(Animation animation) {
            }

            @Override
            public void onAnimationEnd(Animation animation) {
                MainActivity.this.Bell.startAnimation(MainActivity.this.RHangingEnd);
            }
        });
        this.RHangingEnd.setAnimationListener(new Animation.AnimationListener() {
            @Override
            public void onAnimationRepeat(Animation animation) {
            }

            @Override
            public void onAnimationStart(Animation animation) {
            }

            @Override
            public void onAnimationEnd(Animation animation) {
                MainActivity.this.isCompletedAnimation = true;
            }
        });
        this.LightDarkIcon.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                MainActivity.this.closeSlidingDrawer();
                MainActivity.this.showThemeSelectionDialog();
            }
        });
        this.GodPooja.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                if (MainActivity.isGroup) {
                    MainActivity.this.stopAutoChanting();
                    if (PSharedPreference.getBoolean(MainActivity.this, "G" + MainActivity.this.GRPID, true)) {
                        PSharedPreference.setBoolean(MainActivity.this, "G" + MainActivity.this.GRPID, false);
                        MainActivity.this.festivalPublicGroup.setVisibility(8);
                        return;
                    }
                    PSharedPreference.setBoolean(MainActivity.this, "G" + MainActivity.this.GRPID, true);
                    MainActivity.this.festivalPublicGroup.setVisibility(0);
                    ?? r5 = MainActivity.this;
                    FallAnimation.createLeafHeap(r5, r5.GodPooja.getDrawable(), MainActivity.this.LeafHeapContainer);
                }
            }
        });
        this.Bell.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                if (!MainActivity.this.isCompletedAnimation) {
                    MainActivity.this.playBell();
                } else {
                    MainActivity.this.Bell.startAnimation(MainActivity.this.RHangingStart);
                }
            }
        });
        this.drawer_Graph.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                if (MainActivity.this.isMediaPlayerPlaying()) {
                    MainActivity.this.innerPauseMediaPlayer = true;
                }
                PIntent.goNewScreen(MainActivity.this, Graph.class);
                MainActivity.this.closeSlidingDrawer();
                LoadAdClass1.LoadIAd(MainActivity.this);
            }
        });
        this.drawer_Theme.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                MainActivity.this.closeSlidingDrawer();
                MainActivity.themeLayout.startAnimation(MainActivity.fadein);
            }
        });
        this.counterLayout.setOnTouchListener(new View.OnTouchListener() {
            @Override
            public boolean onTouch(View view, MotionEvent motionEvent) {
                if (MainActivity.this.option_tapId != 0) {
                    if (motionEvent.getAction() == 0) {
                        if (MainActivity.this.option_tapId == 1) {
                            MainActivity.this.main_counter.setAlpha(1.0f);
                        }
                    } else if (motionEvent.getAction() == 1) {
                        if (MainActivity.this.snackbar_resetdone != null && MainActivity.this.snackbar_resetdone.isShown()) {
                            MainActivity.this.snackbar_resetdone.dismiss();
                        }
                        if (MainActivity.this.option_tapId == 1) {
                            MainActivity.this.main_counter.setAlpha(0.0f);
                            MainActivity.this.increaseCounter();
                        } else if (MainActivity.this.option_tapId == 2) {
                            if (MainActivity.this.isShow) {
                                ?? r5 = MainActivity.this;
                                if (PSharedPreference.getInteger((Context) r5, r5.getResources().getStringArray(R.array.ProductID)[0], 0) != 1 && !UserWebService.Prime.equals("1")) {
                                    MainActivity.this.gifPrime.startAnimation(MainActivity.scaleTapout);
                                }
                                MainActivity.this.whiteframeLayout.startAnimation(MainActivity.scaleTapout);
                                if (MainActivity.this.isMediaPlayerPlaying()) {
                                    MainActivity.this.extfileplay.startAnimation(MainActivity.scaleTapout);
                                } else {
                                    MainActivity.this.extfileplay.startAnimation(MainActivity.scaleTapout);
                                }
                                MainActivity.this.isShow = false;
                            } else {
                                ?? r52 = MainActivity.this;
                                if (PSharedPreference.getInteger((Context) r52, r52.getResources().getStringArray(R.array.ProductID)[0], 0) != 1 && !UserWebService.Prime.equals("1")) {
                                    MainActivity.this.gifPrime.startAnimation(MainActivity.scaleTapIn);
                                }
                                MainActivity.this.whiteframeLayout.startAnimation(MainActivity.scaleTapIn);
                                if (MainActivity.this.isMediaPlayerPlaying()) {
                                    if (!MainActivity.this.bgMediaPlayer.isPlaying() && !MainActivity.this.bgMediaPlayer.isLooping() && MainActivity.this.extfileplay.getVisibility() != 0) {
                                        MainActivity.this.extfileplay.startAnimation(MainActivity.scaleTapIn);
                                    }
                                } else {
                                    MainActivity.this.extfileplay.startAnimation(MainActivity.scaleTapIn);
                                }
                                MainActivity.this.isShow = true;
                            }
                        }
                    }
                }
                return true;
            }
        });
        scaleTapIn.setAnimationListener(new Animation.AnimationListener() {
            @Override
            public void onAnimationRepeat(Animation animation) {
            }

            @Override
            public void onAnimationStart(Animation animation) {
            }

            @Override
            public void onAnimationEnd(Animation animation) {
                ?? r3 = MainActivity.this;
                if (PSharedPreference.getInteger((Context) r3, r3.getResources().getStringArray(R.array.ProductID)[0], 0) != 1 && !UserWebService.Prime.equals("1")) {
                    MainActivity.this.gifPrime.setVisibility(0);
                }
                MainActivity.this.whiteframeLayout.setVisibility(0);
                MainActivity.this.extfileplay.setVisibility(0);
            }
        });
        scaleTapout.setAnimationListener(new Animation.AnimationListener() {
            @Override
            public void onAnimationRepeat(Animation animation) {
            }

            @Override
            public void onAnimationStart(Animation animation) {
            }

            @Override
            public void onAnimationEnd(Animation animation) {
                ?? r3 = MainActivity.this;
                if (PSharedPreference.getInteger((Context) r3, r3.getResources().getStringArray(R.array.ProductID)[0], 0) != 1 && !UserWebService.Prime.equals("1")) {
                    MainActivity.this.gifPrime.setVisibility(4);
                }
                MainActivity.this.whiteframeLayout.setVisibility(4);
                if (MainActivity.this.bgMediaPlayer.isPlaying() || MainActivity.this.bgMediaPlayer.isLooping()) {
                    return;
                }
                MainActivity.this.extfileplay.setVisibility(4);
            }
        });
        this.translateDown = AnimationUtils.loadAnimation(this, R.anim.translate_down);
        this.translateUp = AnimationUtils.loadAnimation(this, R.anim.translate_up);
        this.translateDown.setAnimationListener(new Animation.AnimationListener() {
            @Override
            public void onAnimationRepeat(Animation animation) {
            }

            @Override
            public void onAnimationStart(Animation animation) {
            }

            @Override
            public void onAnimationEnd(Animation animation) {
                MainActivity.this.counterLayout.startAnimation(MainActivity.this.translateUp);
                MainActivity.this.numberLayoutforAnimation.startAnimation(MainActivity.this.translateUp);
            }
        });
        this.translateUp.setAnimationListener(new Animation.AnimationListener() {
            @Override
            public void onAnimationEnd(Animation animation) {
            }

            @Override
            public void onAnimationRepeat(Animation animation) {
            }

            @Override
            public void onAnimationStart(Animation animation) {
                if (MainActivity.this.themeid == 1) {
                    MainActivity.this.setRed(true);
                    return;
                }
                if (MainActivity.this.themeid == 2) {
                    MainActivity.this.setBlue(true);
                    return;
                }
                if (MainActivity.this.themeid == 3) {
                    MainActivity.this.setLavender(true);
                    return;
                }
                if (MainActivity.this.themeid == 4) {
                    MainActivity.this.setDark(true);
                } else if (MainActivity.this.themeid == 5) {
                    MainActivity.this.setOrange(true);
                } else if (MainActivity.this.themeid == 6) {
                    MainActivity.this.setGolden(true);
                }
            }
        });
        photoLayoutImg.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                if (!MainActivity.this.isNetwork) {
                    if (MainActivity.isGroup) {
                        return;
                    }
                    String string = PSharedPreference.getString(MainActivity.this, "IMG_PHOTO", "Gallery");
                    if (NetworkUtil.isInternetAvailable(MainActivity.this)) {
                        MainActivity.this.isNetwork = true;
                        Glide.with(MainActivity.this).load(string).diskCacheStrategy(DiskCacheStrategy.ALL).skipMemoryCache(false).centerCrop().into(MainActivity.photoLayoutImg);
                        return;
                    } else {
                        Glide.with(MainActivity.this).load(Integer.valueOf(R.drawable.no_network)).centerCrop().into(MainActivity.photoLayoutImg);
                        return;
                    }
                }
                MainActivity.setLanguage(MainActivity.this);
                ?? r3 = MainActivity.this;
                PToast.showT((Context) r3, r3.getResources().getString(R.string.longClickToImage));
            }
        });
        this.videoView.setOnLongClickListener(new View.OnLongClickListener() {
            @Override
            public boolean onLongClick(View view) {
                if (MainActivity.isGroup) {
                    MainActivity.this.StopGroupChantingFeature();
                    return true;
                }
                if (!IsInternet.check(MainActivity.this)) {
                    return true;
                }
                if (UserDataPref.isLogin(MainActivity.this)) {
                    Add_New_Mantra_List.isEdit = false;
                    PIntent.goNewScreen(MainActivity.this, GodVideo.class);
                    return true;
                }
                UserDataPref.noLogin(MainActivity.this);
                return true;
            }
        });
        photoLayoutImg.setOnLongClickListener(new View.OnLongClickListener() {
            @Override
            public boolean onLongClick(View view) {
                if (MainActivity.isGroup) {
                    MainActivity.this.StopGroupChantingFeature();
                } else if (IsInternet.check(MainActivity.this)) {
                    if (!MainActivity.this.isNetwork) {
                        String string = PSharedPreference.getString(MainActivity.this, "IMG_PHOTO", "Gallery");
                        if (NetworkUtil.isInternetAvailable(MainActivity.this)) {
                            MainActivity.this.isNetwork = true;
                            if (string.equals("Gallery")) {
                                PIntent.goNewScreen(MainActivity.this, GodImage.class);
                            } else {
                                Glide.with(MainActivity.this).load(string).diskCacheStrategy(DiskCacheStrategy.ALL).skipMemoryCache(false).centerCrop().into(MainActivity.photoLayoutImg);
                            }
                        } else {
                            Glide.with(MainActivity.this).load(Integer.valueOf(R.drawable.no_network)).centerCrop().into(MainActivity.photoLayoutImg);
                        }
                    } else {
                        GodImage.isOnlySelect = false;
                        PIntent.goNewScreen(MainActivity.this, GodImage.class);
                    }
                }
                return true;
            }
        });
        if (PSharedPreference.getBoolean(this, "FULLSCREEN", false)) {
            getWindow().addFlags(1024);
        }
        this.extfileplay.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                if (IsInternet.check(MainActivity.this)) {
                    if (MainActivity.this.snackbar_resetdone != null && MainActivity.this.snackbar_resetdone.isShown()) {
                        MainActivity.this.snackbar_resetdone.dismiss();
                    }
                    String trim = PSharedPreference.getString(MainActivity.this, "MUSIC_FILE", "null").trim();
                    if (trim.equals("null")) {
                        MainActivity.this.innerPauseforLoadGroup = false;
                        GetMusic.isSelectforReminder = false;
                        GetMusic.isSelectforNewList = false;
                        PIntent.goNewScreen(MainActivity.this, GetMusic.class);
                        return;
                    }
                    if (MainActivity.this.bgMediaPlayer == null) {
                        MainActivity.this.GetReadyMusicPlayer(trim, false, !trim.startsWith("https"));
                    }
                    MainActivity.this.showMusicPlayer(trim);
                }
            }
        });
        if (PRateShareETC.askforRate(this, "Rate", new int[]{5, 10, 15, 30, 80})) {
            PDialog.showSimple(this, new DialogInterface.OnClickListener() {
                @Override
                public void onClick(DialogInterface dialogInterface, int i) {
                    if (i == -1) {
                        PRateShareETC.rate(MainActivity.this);
                        PSharedPreference.setInteger(MainActivity.this, "Rate", 400);
                    }
                }
            }, "", getResources().getString(R.string.rate_5star), getResources().getString(R.string.Yes), getResources().getString(R.string.No));
        } else {
            if (PSharedPreference.getInteger(this, "Rate", 0) > 500) {
                PSharedPreference.setInteger(this, "Rate", 400);
            }
            PAds.loadAds(this, this, false);
        }
        this.target.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                if (MainActivity.this.snackbar_resetdone != null && MainActivity.this.snackbar_resetdone.isShown()) {
                    MainActivity.this.snackbar_resetdone.dismiss();
                }
                if (MainActivity.isGroup) {
                    MainActivity.this.StopGroupChantingFeature();
                    return;
                }
                AlertDialog.Builder builder = new AlertDialog.Builder(MainActivity.this);
                MainActivity.setLanguage(MainActivity.this);
                builder.setMessage(MainActivity.this.getResources().getString(R.string.target));
                final EditText editText = new EditText(MainActivity.this);
                editText.setInputType(2);
                editText.setHint(MainActivity.this.getResources().getString(R.string.notarget_hint));
                editText.setLayoutParams(new LinearLayout.LayoutParams(-1, -1));
                builder.setView(editText);
                builder.setPositiveButton(MainActivity.this.getResources().getString(R.string.Yes), new DialogInterface.OnClickListener() {
                    @Override
                    public void onClick(DialogInterface dialogInterface, int i) {
                        long j;
                        if (editText.getText().toString().length() > 0) {
                            try {
                                j = Long.parseLong(editText.getText().toString());
                            } catch (NumberFormatException unused) {
                                PToast.showT(MainActivity.this, "Invalid input. Please enter a number.");
                                j = 0;
                            }
                            LoadAdClass2.LoadIAd(MainActivity.this);
                            if (j > 0) {
                                if (j > 999999999) {
                                    PSharedPreference.setLong(MainActivity.this, "TGT", 999999999L);
                                    MainActivity.this.target.setText("999999999");
                                    UpdateDb.UpdateTarget(MainActivity.this, 999999999L);
                                } else {
                                    if (MainActivity.counter >= j) {
                                        MainActivity.counter = 0L;
                                        PSharedPreference.setLong(MainActivity.this, "NUMBER", 0L);
                                        MainActivity.this.numbers.setText(MainActivity.this.df_small.format(MainActivity.counter));
                                        MainActivity.this.numbers2.setText(MainActivity.this.df_small.format(MainActivity.counter));
                                        MainActivity.this.changeProgressBar(MainActivity.this.progress_Bar, 0);
                                    }
                                    PSharedPreference.setLong(MainActivity.this, "TGT", j);
                                    PSharedPreference.setLong(MainActivity.this, "ROUND", 0L);
                                    UpdateDb.UpdateTarget(MainActivity.this, j);
                                    UpdateDb.UpdateRound(MainActivity.this, 0L);
                                    MainActivity.this.tgt_rounds.setText(MainActivity.this.df_target_round.format(PSharedPreference.getLong(MainActivity.this, "ROUND", 0L)));
                                    MainActivity.this.target.setText(MainActivity.this.df_inr.format(PSharedPreference.getLong(MainActivity.this, "TGT", 0L)));
                                }
                                MainActivity.this.rel_layout.setVisibility(0);
                                MainActivity.this.progress_Layout.setVisibility(0);
                                return;
                            }
                            MainActivity.this.progress_Layout.setVisibility(4);
                            MainActivity.this.rel_layout.setVisibility(8);
                            PSharedPreference.setLong(MainActivity.this, "TGT", j);
                            UpdateDb.UpdateTarget(MainActivity.this, j);
                            MainActivity.this.target.setText(MainActivity.this.getResources().getString(R.string.target_txt));
                        }
                    }
                });
                builder.setNegativeButton(MainActivity.this.getResources().getString(R.string.No), new DialogInterface.OnClickListener() {
                    @Override
                    public void onClick(DialogInterface dialogInterface, int i) {
                        dialogInterface.cancel();
                    }
                });
                AlertDialog create = builder.create();
                MainActivity.setLanguage(MainActivity.this);
                create.show();
            }
        });
        this.tgt_rounds.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                Snackbar.make(MainActivity.this.main_reset, MainActivity.this.getResources().getString(R.string.long_press_reset), 0).show();
            }
        });
        this.tgt_rounds.setOnLongClickListener(new View.OnLongClickListener() {
            @Override
            public boolean onLongClick(View view) {
                PSharedPreference.setLong(MainActivity.this, "ROUND", 0L);
                UpdateDb.UpdateRound(MainActivity.this, 0L);
                MainActivity.this.tgt_rounds.setText(MainActivity.this.df_target_round.format(PSharedPreference.getLong(MainActivity.this, "ROUND", 0L)));
                return true;
            }
        });
        this.closeDrawer.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                MainActivity.this.closeSlidingDrawer();
            }
        });
        this.menuAboveTarget.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                MainActivity.this.openSlidingDrawer();
            }
        });
        this.menuphoto.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                MainActivity.this.openSlidingDrawer();
            }
        });
        this.menu_Powersaver.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                MainActivity.this.openSlidingDrawer();
            }
        });
        this.SimpleModeReset.setOnClickListener(new AnonymousClass102());
        this.main_reset.setOnTouchListener(new AnonymousClass103());
        this.main_counter.setOnTouchListener(new View.OnTouchListener() {
            @Override
            public boolean onTouch(View view, MotionEvent motionEvent) {
                if (motionEvent.getAction() == 0) {
                    MainActivity.this.main_counter.setAlpha(1.0f);
                } else if (motionEvent.getAction() == 1) {
                    MainActivity.this.main_counter.setAlpha(0.0f);
                    if (MainActivity.this.snackbar_resetdone != null && MainActivity.this.snackbar_resetdone.isShown()) {
                        MainActivity.this.snackbar_resetdone.dismiss();
                    }
                    MainActivity.this.increaseCounter();
                }
                return true;
            }
        });
        this.AutoChanting.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                if (!MainActivity.isStartAutoChanting) {
                    new AlertDialog.Builder(MainActivity.this).setTitle("🔁" + MainActivity.this.getResources().getString(R.string.autochantingTitle)).setMessage(MainActivity.this.getResources().getString(R.string.autochanting_desc)).setIcon(R.drawable.auto_chant_normal).setPositiveButton(MainActivity.this.getResources().getString(R.string.start_autochanting), new DialogInterface.OnClickListener() {
                        @Override
                        public void onClick(DialogInterface dialogInterface, int i) {
                            MainActivity.isStartAutoChanting = true;
                            MainActivity.this.startAutoChanting(false);
                        }
                    }).setCancelable(false).setNegativeButton(MainActivity.this.getResources().getString(R.string.No), new DialogInterface.OnClickListener() {
                        @Override
                        public void onClick(DialogInterface dialogInterface, int i) {
                        }
                    }).show();
                    return;
                }
                MainActivity.isStartAutoChanting = false;
                MainActivity.this.stopAutoChanting();
            }
        });
        this.AutoChanting_GodPooja.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                if (!MainActivity.isStartAutoChanting) {
                    MainActivity.isStartAutoChanting = true;
                    MainActivity.this.startAutoChanting(true);
                } else {
                    MainActivity.isStartAutoChanting = false;
                    MainActivity.this.stopAutoChanting();
                }
            }
        });
        if (ISidMatch) {
            return;
        }
        AlertDialog.Builder builder = new AlertDialog.Builder(this);
        builder.setTitle(getResources().getString(R.string.account_usage));
        builder.setMessage(getResources().getString(R.string.loginlogoutdesc));
        builder.setPositiveButton(getResources().getString(R.string.loginhere), new DialogInterface.OnClickListener() {
            @Override
            public final void onClick(DialogInterface dialogInterface, int i) {
                MainActivity.this.m282lambda$onCreate$0$comsweetedgemantracounterMainActivity(dialogInterface, i);
            }
        });
        builder.setNegativeButton(getResources().getString(R.string.logout), new DialogInterface.OnClickListener() {
            @Override
            public final void onClick(DialogInterface dialogInterface, int i) {
                MainActivity.this.m283lambda$onCreate$1$comsweetedgemantracounterMainActivity(dialogInterface, i);
            }
        });
        builder.setCancelable(false);
        builder.show();
    }

    class AnonymousClass102 implements View.OnClickListener {
        AnonymousClass102() {
        }

        @Override
        public void onClick(View view) {
            DialogInterface.OnClickListener onClickListener = new DialogInterface.OnClickListener() {
                @Override
                public void onClick(DialogInterface dialogInterface, int i) {
                    if (i == -1) {
                        MainActivity.temp_count = MainActivity.counter;
                        MainActivity.temp_graph_counter = MainActivity.graph_counter;
                        MainActivity.this.snackbar_resetdone = Snackbar.make(MainActivity.this.main_reset, MainActivity.this.getResources().getString(R.string.reset_complete), -2).setAction("UNDO", new View.OnClickListener() {
                            @Override
                            public void onClick(View view2) {
                                Snackbar.make(MainActivity.this.main_reset, MainActivity.this.getResources().getString(R.string.undo_success), -1).show();
                                MainActivity.counter = MainActivity.temp_count;
                                MainActivity.graph_counter = MainActivity.temp_graph_counter;
                                MainActivity.this.numbers.setText(MainActivity.this.df_big.format(MainActivity.counter));
                                MainActivity.this.numbers2.setText(MainActivity.this.df_big.format(MainActivity.counter));
                                PSharedPreference.setLong(MainActivity.this, "NUMBER", MainActivity.counter);
                                PSharedPreference.setLong(MainActivity.this, "GRPH_NUMBER", MainActivity.graph_counter);
                            }
                        });
                        MainActivity.this.snackbar_resetdone.show();
                        MainActivity.counter = 0L;
                        if (PSharedPreference.getBoolean(MainActivity.this, "DAILY_RESET", false)) {
                            Database database = new Database(MainActivity.this);
                            database.open();
                            database.deletetoday();
                            Cursor lastRecord = database.getLastRecord();
                            if (lastRecord != null) {
                                if (lastRecord.moveToLast()) {
                                    Long valueOf = Long.valueOf(Long.parseLong(lastRecord.getString(1)));
                                    MainActivity.counter = 0L;
                                    MainActivity.graph_counter = valueOf.longValue();
                                    PSharedPreference.setLong(MainActivity.this, "NUMBER", valueOf.longValue());
                                    PSharedPreference.setLong(MainActivity.this, "GRPH_COUNTER", valueOf.longValue());
                                } else {
                                    MainActivity.counter = 0L;
                                    MainActivity.graph_counter = 0L;
                                    PSharedPreference.setLong(MainActivity.this, "NUMBER", 0L);
                                    PSharedPreference.setLong(MainActivity.this, "GRPH_COUNTER", 0L);
                                }
                            } else {
                                MainActivity.counter = 0L;
                                MainActivity.graph_counter = 0L;
                                PSharedPreference.setLong(MainActivity.this, "NUMBER", 0L);
                                PSharedPreference.setLong(MainActivity.this, "GRPH_COUNTER", 0L);
                            }
                            database.close();
                        }
                        PSharedPreference.setLong(MainActivity.this, "NUMBER", 0L);
                        MainActivity.this.numbers.setText(MainActivity.this.df_big.format(MainActivity.counter));
                        MainActivity.this.numbers2.setText(MainActivity.this.df_big.format(MainActivity.counter));
                        MainActivity.this.setVib(500);
                    }
                }
            };
            ?? r0 = MainActivity.this;
            PDialog.showSimple((Context) r0, onClickListener, "Reset ?", r0.getResources().getString(R.string.reset_complete), MainActivity.this.getResources().getString(R.string.Yes), MainActivity.this.getResources().getString(R.string.No));
        }
    }

    class AnonymousClass103 implements View.OnTouchListener {
        AnonymousClass103() {
        }

        @Override
        public boolean onTouch(View view, MotionEvent motionEvent) {
            if (motionEvent.getAction() == 0) {
                MainActivity.this.main_reset.setAlpha(1.0f);
                MainActivity.this.setVib(80);
                MainActivity.this.TimeinMillisecond = System.currentTimeMillis();
            } else if (motionEvent.getAction() == 1) {
                MainActivity.this.main_reset.setAlpha(0.0f);
                if (System.currentTimeMillis() - MainActivity.this.TimeinMillisecond >= 1000) {
                    DialogInterface.OnClickListener onClickListener = new DialogInterface.OnClickListener() {
                        @Override
                        public void onClick(DialogInterface dialogInterface, int i) {
                            if (i == -1) {
                                MainActivity.temp_count = MainActivity.counter;
                                MainActivity.temp_graph_counter = MainActivity.graph_counter;
                                MainActivity.this.snackbar_resetdone = Snackbar.make(MainActivity.this.main_reset, MainActivity.this.getResources().getString(R.string.reset_complete), -2).setAction("UNDO", new View.OnClickListener() {
                                    @Override
                                    public void onClick(View view2) {
                                        Snackbar.make(MainActivity.this.main_reset, MainActivity.this.getResources().getString(R.string.undo_success), -1).show();
                                        MainActivity.counter = MainActivity.temp_count;
                                        MainActivity.graph_counter = MainActivity.temp_graph_counter;
                                        MainActivity.this.numbers.setText(MainActivity.this.df_big.format(MainActivity.counter));
                                        MainActivity.this.numbers2.setText(MainActivity.this.df_big.format(MainActivity.counter));
                                        PSharedPreference.setLong(MainActivity.this, "NUMBER", MainActivity.counter);
                                        PSharedPreference.setLong(MainActivity.this, "GRPH_NUMBER", MainActivity.graph_counter);
                                    }
                                });
                                MainActivity.this.snackbar_resetdone.show();
                                MainActivity.counter = 0L;
                                if (PSharedPreference.getBoolean(MainActivity.this, "DAILY_RESET", false)) {
                                    Database database = new Database(MainActivity.this);
                                    database.open();
                                    database.deletetoday();
                                    Cursor lastRecord = database.getLastRecord();
                                    if (lastRecord != null) {
                                        if (lastRecord.moveToLast()) {
                                            Long valueOf = Long.valueOf(Long.parseLong(lastRecord.getString(1)));
                                            MainActivity.counter = 0L;
                                            MainActivity.graph_counter = valueOf.longValue();
                                            PSharedPreference.setLong(MainActivity.this, "NUMBER", valueOf.longValue());
                                            PSharedPreference.setLong(MainActivity.this, "GRPH_COUNTER", valueOf.longValue());
                                        } else {
                                            MainActivity.counter = 0L;
                                            MainActivity.graph_counter = 0L;
                                            PSharedPreference.setLong(MainActivity.this, "NUMBER", 0L);
                                            PSharedPreference.setLong(MainActivity.this, "GRPH_COUNTER", 0L);
                                        }
                                    } else {
                                        MainActivity.counter = 0L;
                                        MainActivity.graph_counter = 0L;
                                        PSharedPreference.setLong(MainActivity.this, "NUMBER", 0L);
                                        PSharedPreference.setLong(MainActivity.this, "GRPH_COUNTER", 0L);
                                    }
                                    database.close();
                                }
                                PSharedPreference.setLong(MainActivity.this, "NUMBER", 0L);
                                MainActivity.this.numbers.setText(MainActivity.this.df_big.format(MainActivity.counter));
                                MainActivity.this.numbers2.setText(MainActivity.this.df_big.format(MainActivity.counter));
                                MainActivity.this.setVib(500);
                            }
                        }
                    };
                    ?? r1 = MainActivity.this;
                    PDialog.showSimple((Context) r1, onClickListener, "Reset ?", r1.getResources().getString(R.string.reset_complete), MainActivity.this.getResources().getString(R.string.Yes), MainActivity.this.getResources().getString(R.string.No));
                } else {
                    Snackbar.make(MainActivity.this.main_reset, MainActivity.this.getResources().getString(R.string.long_press_reset), 0).show();
                }
            }
            return true;
        }
    }

    void m282lambda$onCreate$0$comsweetedgemantracounterMainActivity(DialogInterface dialogInterface, int i) {
        UserWebService.UpdateID(this, U_Gmail, Authentication.getDeviceID(this));
    }

    void m283lambda$onCreate$1$comsweetedgemantracounterMainActivity(DialogInterface dialogInterface, int i) {
        UserWebService.logOutSetLastUseOff(this, U_Gmail);
    }

    private void handleCustomAction(String str) {
        PIntent.goNewScreen(this, MyGroup.class);
    }

    public void stopAutoChanting() {
        if (isGroup) {
            this.AutoChanting_GodPooja.setImageResource(R.drawable.auto_chant_normal);
        }
        this.AutoChanting.setImageResource(R.drawable.auto_chant_normal);
        Runnable runnable = this.autorunnable;
        if (runnable != null) {
            this.autohandler.removeCallbacks(runnable);
            this.autorunnable = null;
        }
    }

    public void startAutoChanting(final boolean z) {
        if (isGroup) {
            this.AutoChanting_GodPooja.setImageResource(R.drawable.auto_chanting);
        }
        this.AutoChanting.setImageResource(R.drawable.auto_chanting);
        Runnable runnable = new Runnable() {
            @Override
            public void run() {
                if (!z) {
                    MainActivity.this.increaseCounter();
                } else {
                    MainActivity.this.flowerBtn.performClick();
                }
                if (MainActivity.this.isDefaultMediaSound) {
                    MainActivity.this.autohandler.postDelayed(MainActivity.this.autorunnable, 1000L);
                } else if (MainActivity.isGroup) {
                    MainActivity.this.autohandler.postDelayed(MainActivity.this.autorunnable, 600L);
                } else {
                    MainActivity.this.autohandler.postDelayed(MainActivity.this.autorunnable, 300L);
                }
            }
        };
        this.autorunnable = runnable;
        this.autohandler.postDelayed(runnable, 100L);
    }

    public void showThemeSelectionDialog() {
        View inflate = getLayoutInflater().inflate(R.layout.light_dark_mode_dialog, (ViewGroup) null);
        AlertDialog.Builder title = new AlertDialog.Builder(this).setTitle(getResources().getString(R.string.theme));
        title.setView(inflate);
        final AlertDialog create = title.create();
        RadioGroup radioGroup = (RadioGroup) inflate.findViewById(R.id.themeRadioGroup);
        RadioButton radioButton = (RadioButton) inflate.findViewById(R.id.radioLightMode);
        RadioButton radioButton2 = (RadioButton) inflate.findViewById(R.id.radioDarkMode);
        RadioButton radioButton3 = (RadioButton) inflate.findViewById(R.id.radioAuto);
        Button button = (Button) inflate.findViewById(R.id.confirmButton);
        int integer = PSharedPreference.getInteger(this, "THEME_LIGHT_DARK", 1);
        this.savedId = integer;
        if (integer == 1) {
            radioButton.setChecked(true);
        } else if (integer == 0) {
            radioButton2.setChecked(true);
        } else if (integer == 8) {
            radioButton3.setChecked(true);
        }
        radioGroup.setOnCheckedChangeListener(new RadioGroup.OnCheckedChangeListener() {
            @Override
            public void onCheckedChanged(RadioGroup radioGroup2, int i) {
                if (i == R.id.radioAuto) {
                    MainActivity.this.savedId = 8;
                } else if (i == R.id.radioLightMode) {
                    MainActivity.this.savedId = 1;
                } else if (i == R.id.radioDarkMode) {
                    MainActivity.this.savedId = 0;
                }
            }
        });
        button.setOnClickListener(new View.OnClickListener() {
            @Override
            public final void onClick(View view) {
                MainActivity.this.m284x100aca1f(create, view);
            }
        });
        create.show();
    }

    void m284x100aca1f(AlertDialog alertDialog, View view) {
        int i = this.savedId;
        if (i == 1) {
            setAppTheme(1);
        } else if (i == 0) {
            setAppTheme(2);
        } else if (i == 8) {
            setAppTheme(-1);
        }
        saveThemePreference(this.savedId);
        alertDialog.dismiss();
    }

    private void setAppTheme(int i) {
        AppCompatDelegate.setDefaultNightMode(i);
    }

    private void saveThemePreference(int i) {
        PSharedPreference.setInteger(this, "THEME_LIGHT_DARK", i);
    }

    private String getDefaultMusicURI() {
        try {
            return PSharedPreference.getString(this, "MUSIC_FILE", "null");
        } catch (Exception unused) {
            return "null";
        }
    }

    public void gotoMantraListClass(Context context) {
        if (!PSharedPreference.getBoolean(this, "ADD_DEFAULT_LIST", false)) {
            MantraListDb mantraListDb = new MantraListDb(context);
            mantraListDb.open();
            mantraListDb.insert_data("0", "Default", counter, PSharedPreference.getLong(this, "ROUND", 0L), PSharedPreference.getLong(this, "MUSIC", 0L), getDefaultMusicURI(), PSharedPreference.getString(this, "Mantra", "Default"), PSharedPreference.getString(this, "IMG_PHOTO", "Gallery"), PSharedPreference.getInteger(this, "THEMES", 1) + "", String.valueOf(PSharedPreference.getBoolean(this, "PHOTOMODE", true)), "", "");
            mantraListDb.close();
            mantraListDb.open();
            Cursor all = mantraListDb.getAll();
            if (all != null && all.getCount() > 0) {
                PSharedPreference.setBoolean(this, "ADD_DEFAULT_LIST", true);
            }
            all.close();
            mantraListDb.close();
        }
        if (isMediaPlayerPlaying()) {
            this.innerPauseMediaPlayer = true;
        }
        closeSlidingDrawer();
        PIntent.goNewScreen(context, MantraList.class);
    }

    public static void ShowLoginDialog(Activity activity) {
        PIntent.goNewScreenwithFinishedThis(activity, Authentication.class);
    }

    public void StopGroupChantingFeature() {
        PDialog.showSimple(this, new DialogInterface.OnClickListener() {
            @Override
            public void onClick(DialogInterface dialogInterface, int i) {
                if (i == -1) {
                    GroupWebService.updateJapaCounteronServer(MainActivity.this, MainActivity.counter, Long.parseLong(PSharedPreference.getString(MainActivity.this, GroupConst.Grptarget, "0")), MainActivity.U_Gmail);
                    PSharedPreference.setBoolean(MainActivity.this, GroupConst.isGroup, false);
                    PSharedPreference.setString(MainActivity.this, GroupConst.Grpid, "null");
                    MainActivity.this.setLocalJapa();
                    MainActivity.this.setUpPhotoOrVideoMode(false);
                }
            }
        }, getResources().getString(R.string.stop), getResources().getString(R.string.stopgroupchanting), getResources().getString(R.string.Yes), getResources().getString(R.string.No));
    }

    public void closeSlidingDrawer() {
        this.mDrawerLayout.close();
        if (this.PowerSaverMode) {
            LoadAdClass1.showIAd(this);
        }
    }

    public void openSlidingDrawer() {
        Snackbar snackbar = this.snackbar_resetdone;
        if (snackbar != null && snackbar.isShown()) {
            this.snackbar_resetdone.dismiss();
        }
        this.BottomScreen.setVisibility(0);
        StoredataintoDatabase();
        MakeDrawerGraphReady();
        this.mDrawerLayout.open();
        if (this.PowerSaverMode) {
            LoadAdClass1.LoadIAd(this);
        }
    }

    private void MakeDrawerGraphReady() {
        ArrayList arrayList = new ArrayList();
        LineChartView findViewById = findViewById(R.id.linechart_drawer);
        ArrayList arrayList2 = new ArrayList();
        arrayList.add("0");
        Database database = new Database(this);
        database.open();
        Cursor lastfour = database.getLastfour();
        if (lastfour != null) {
            if (lastfour.moveToLast()) {
                long j = 0;
                int i = 1;
                do {
                    if (i > 2) {
                        long parseLong = Long.parseLong(lastfour.getString(1)) - j;
                        j = Long.parseLong(lastfour.getString(1));
                        arrayList.add(lastfour.getString(0));
                        arrayList2.add(new PointValue(Math.abs(i), Math.abs(parseLong)));
                    } else if (i == 1) {
                        j = Long.parseLong(lastfour.getString(1));
                        arrayList.add(lastfour.getString(0));
                    } else if (i == 2) {
                        long parseLong2 = Long.parseLong(lastfour.getString(1)) - j;
                        j = Long.parseLong(lastfour.getString(1));
                        arrayList.add(lastfour.getString(0));
                        arrayList2.add(new PointValue(2.0f, parseLong2));
                    }
                    i++;
                } while (lastfour.moveToPrevious());
                Line cubic = new Line(arrayList2).setColor(ContextCompat.getColor(this, R.color.orangeFontColor)).setCubic(false);
                ArrayList arrayList3 = new ArrayList();
                arrayList3.add(cubic);
                cubic.setFilled(true);
                cubic.setHasLabels(true);
                ArrayList arrayList4 = new ArrayList();
                float f = 0.0f;
                for (int i2 = 0; i2 < arrayList.size(); i2++) {
                    arrayList4.add(new AxisValue(f).setLabel((String) arrayList.get(i2)));
                    f += 1.0f;
                }
                Axis axis = new Axis(arrayList4);
                Axis hasLines = new Axis().setHasLines(true);
                axis.setName(getResources().getString(R.string.dt));
                hasLines.setName(getResources().getString(R.string.app_name));
                axis.setTextColor(Color.parseColor("#414141"));
                axis.setTextSize(15);
                hasLines.setTextColor(ContextCompat.getColor(this, R.color.orangeFontColor));
                hasLines.setTextSize(15);
                axis.setInside(false);
                axis.setHasTiltedLabels(true);
                axis.setHasSeparationLine(true);
                LineChartData lineChartData = new LineChartData();
                lineChartData.setLines(arrayList3);
                lineChartData.setAxisXBottom(axis);
                lineChartData.setAxisYLeft(hasLines);
                if (arrayList.size() <= 4) {
                    findViewById.setVisibility(8);
                } else {
                    findViewById.setLayoutParams(new LinearLayout.LayoutParams((int) (PScreen.getWidth(this) / 1.14d), (int) (((int) (PScreen.getWidth(this) / 1.14d)) / 1.77d)));
                    findViewById.setLineChartData(lineChartData);
                    findViewById.startAnimation(AnimationUtils.loadAnimation(this, R.anim.fadein));
                }
            } else {
                findViewById.setVisibility(8);
            }
        }
        database.close();
        lastfour.close();
    }

    public void showMusicPlayer(final String str) {
        View inflate = LayoutInflater.from(this).inflate(R.layout.music_player, (ViewGroup) null);
        AlertDialog.Builder builder = new AlertDialog.Builder(this, R.style.CustomDialog);
        builder.setView(inflate);
        SeekBar seekBar = (SeekBar) inflate.findViewById(R.id.mySeekBar);
        final ImageView imageView = (ImageView) inflate.findViewById(R.id.stop_img);
        final ImageView imageView2 = (ImageView) inflate.findViewById(R.id.loop_img);
        ImageView imageView3 = (ImageView) inflate.findViewById(R.id.minimize_img);
        ImageView imageView4 = (ImageView) inflate.findViewById(R.id.list_img);
        TextView textView = (TextView) inflate.findViewById(R.id.track_name);
        final ImageView imageView5 = (ImageView) inflate.findViewById(R.id.fav_img);
        seekBar.setMax(100);
        seekBar.setProgress(100);
        final String substring = str.substring(str.lastIndexOf("/") + 1);
        textView.setText(substring);
        if (PSharedPreference.getBoolean(this, substring, false)) {
            imageView5.setImageResource(R.drawable.fav);
        } else {
            imageView5.setImageResource(R.drawable.no_fav);
        }
        try {
            if (this.bgMediaPlayer.isPlaying()) {
                imageView.setImageResource(R.drawable.stop_music);
            } else {
                imageView.setImageResource(R.drawable.play_music);
            }
        } catch (Exception unused) {
            imageView.setImageResource(R.drawable.play_music);
        }
        imageView5.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                if (!PSharedPreference.getBoolean(MainActivity.this, substring, false)) {
                    imageView5.setImageResource(R.drawable.fav);
                    PSharedPreference.setBoolean(MainActivity.this, substring, true);
                } else {
                    imageView5.setImageResource(R.drawable.no_fav);
                    PSharedPreference.setBoolean(MainActivity.this, substring, false);
                }
            }
        });
        imageView3.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                MainActivity.this.alertMusic.dismiss();
            }
        });
        imageView4.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                MainActivity.this.alertMusic.dismiss();
                GetMusic.isSelectforReminder = false;
                GetMusic.isSelectforNewList = false;
                PIntent.goNewScreen(MainActivity.this, GetMusic.class);
            }
        });
        imageView2.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                if (MainActivity.this.isloop) {
                    MainActivity.this.isloop = false;
                    PToast.showT(MainActivity.this, "No Looping");
                    imageView2.setImageResource(R.drawable.no_loop);
                    MainActivity.this.bgMediaPlayer.setLooping(false);
                    return;
                }
                MainActivity.this.isloop = true;
                PToast.showT(MainActivity.this, "Looping");
                imageView2.setImageResource(R.drawable.loop);
                MainActivity.this.bgMediaPlayer.setLooping(true);
            }
        });
        imageView.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                if (MainActivity.this.bgMediaPlayer != null) {
                    if (MainActivity.this.isMediaPlayerPlaying()) {
                        MainActivity.this.bgMediaPlayer.stop();
                        MainActivity.this.extfileplay.clearAnimation();
                        imageView.setImageResource(R.drawable.play_music);
                    } else {
                        imageView.setImageResource(R.drawable.stop_music);
                        MainActivity.this.GetReadyMusicPlayer(str, true, false);
                        MainActivity.this.bgMediaPlayer.start();
                        MainActivity.this.extfileplay.startAnimation(AnimationUtils.loadAnimation(MainActivity.this, R.anim.blink));
                    }
                }
            }
        });
        seekBar.setOnSeekBarChangeListener(new SeekBar.OnSeekBarChangeListener() {
            @Override
            public void onStartTrackingTouch(SeekBar seekBar2) {
            }

            @Override
            public void onStopTrackingTouch(SeekBar seekBar2) {
            }

            @Override
            public void onProgressChanged(SeekBar seekBar2, int i, boolean z) {
                if (MainActivity.this.bgMediaPlayer == null || !MainActivity.this.bgMediaPlayer.isPlaying()) {
                    return;
                }
                float f = i / 100.0f;
                MainActivity.this.bgMediaPlayer.setVolume(f, f);
            }
        });
        AlertDialog create = builder.create();
        this.alertMusic = create;
        create.show();
    }

    public void SettingMethod() {
        Snackbar snackbar = this.snackbar_resetdone;
        if (snackbar != null && snackbar.isShown()) {
            this.snackbar_resetdone.dismiss();
        }
        if (isMediaPlayerPlaying()) {
            this.innerPauseMediaPlayer = true;
        }
        startActivity(new Intent((Context) this, (Class<?>) Settings.class));
        closeSlidingDrawer();
    }

    public void showTimePicker() {
        AlertDialog.Builder builder = new AlertDialog.Builder(this);
        builder.setMessage(getResources().getString(R.string.timer));
        LinearLayout linearLayout = new LinearLayout(this);
        LinearLayout linearLayout2 = new LinearLayout(this);
        LinearLayout linearLayout3 = new LinearLayout(this);
        LinearLayout linearLayout4 = new LinearLayout(this);
        LinearLayout linearLayout5 = new LinearLayout(this);
        LinearLayout linearLayout6 = new LinearLayout(this);
        final NumberPicker numberPicker = new NumberPicker(this);
        final NumberPicker numberPicker2 = new NumberPicker(this);
        final NumberPicker numberPicker3 = new NumberPicker(this);
        setLanguage(this);
        TextView textView = new TextView(this);
        textView.setText("Hour");
        TextView textView2 = new TextView(this);
        textView2.setText("Minute");
        TextView textView3 = new TextView(this);
        textView3.setText("Second");
        numberPicker.setMaxValue(12);
        numberPicker.setMinValue(0);
        numberPicker2.setMaxValue(60);
        numberPicker2.setMinValue(0);
        numberPicker3.setMaxValue(60);
        numberPicker3.setMinValue(0);
        LinearLayout.LayoutParams layoutParams = new LinearLayout.LayoutParams(-2, -2);
        layoutParams.setMargins(5, 2, 5, 2);
        ViewGroup.LayoutParams layoutParams2 = new LinearLayout.LayoutParams(-1, -1);
        linearLayout2.setOrientation(0);
        linearLayout4.setOrientation(1);
        linearLayout5.setOrientation(1);
        linearLayout6.setOrientation(1);
        linearLayout4.setLayoutParams(layoutParams);
        linearLayout5.setLayoutParams(layoutParams);
        linearLayout6.setLayoutParams(layoutParams);
        linearLayout4.setGravity(17);
        linearLayout5.setGravity(17);
        linearLayout6.setGravity(17);
        linearLayout4.addView(textView);
        linearLayout4.addView(numberPicker);
        linearLayout5.addView(textView2);
        linearLayout5.addView(numberPicker2);
        linearLayout6.addView(textView3);
        linearLayout6.addView(numberPicker3);
        linearLayout2.addView(linearLayout4);
        linearLayout2.addView(linearLayout5);
        linearLayout2.addView(linearLayout6);
        linearLayout.setGravity(17);
        linearLayout.setLayoutParams(layoutParams2);
        TextView textView4 = new TextView(this);
        TextView textView5 = new TextView(this);
        TextView textView6 = new TextView(this);
        textView4.setText("05:00");
        textView5.setText("30:00");
        textView6.setText("01:00:00");
        textView4.setBackground(getDrawable(R.drawable.frame_sky));
        textView5.setBackground(getDrawable(R.drawable.frame_sky));
        textView6.setBackground(getDrawable(R.drawable.frame_sky));
        textView4.setTextAppearance(android.R.style.TextAppearance.Medium);
        textView5.setTextAppearance(android.R.style.TextAppearance.Medium);
        textView6.setTextAppearance(android.R.style.TextAppearance.Medium);
        textView4.setTextColor(-1);
        textView5.setTextColor(-1);
        textView6.setTextColor(-1);
        textView4.setPadding(10, 5, 10, 5);
        textView5.setPadding(10, 5, 10, 5);
        textView6.setPadding(10, 5, 10, 5);
        LinearLayout.LayoutParams layoutParams3 = new LinearLayout.LayoutParams(-2, -2);
        LinearLayout.LayoutParams layoutParams4 = new LinearLayout.LayoutParams(-2, -2);
        LinearLayout.LayoutParams layoutParams5 = new LinearLayout.LayoutParams(-2, -2);
        layoutParams3.setMargins(9, 12, 9, 2);
        layoutParams4.setMargins(9, 12, 9, 2);
        layoutParams5.setMargins(9, 12, 9, 2);
        LinearLayout linearLayout7 = new LinearLayout(this);
        linearLayout7.setLayoutParams(layoutParams2);
        textView4.setLayoutParams(layoutParams3);
        textView5.setLayoutParams(layoutParams4);
        textView6.setLayoutParams(layoutParams5);
        linearLayout7.addView(textView4);
        linearLayout7.addView(textView5);
        linearLayout7.addView(textView6);
        linearLayout7.setGravity(17);
        linearLayout3.setLayoutParams(layoutParams2);
        linearLayout3.setOrientation(1);
        linearLayout.addView(linearLayout2);
        linearLayout3.addView(linearLayout);
        linearLayout3.addView(linearLayout7);
        builder.setView(linearLayout3);
        final int[] iArr = new int[1];
        final int[] iArr2 = new int[1];
        final int[] iArr3 = new int[1];
        textView4.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                MainActivity.this.changeValueByOne(numberPicker3, false);
                MainActivity.this.changeValueByOne(numberPicker2, false);
                MainActivity.this.changeValueByOne(numberPicker, false);
                numberPicker3.setValue(1);
                numberPicker2.setValue(6);
                numberPicker.setValue(1);
                iArr[0] = 0;
                iArr2[0] = 5;
                iArr3[0] = 0;
            }
        });
        textView5.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                MainActivity.this.changeValueByOne(numberPicker3, false);
                MainActivity.this.changeValueByOne(numberPicker2, false);
                MainActivity.this.changeValueByOne(numberPicker, false);
                numberPicker3.setValue(1);
                numberPicker2.setValue(31);
                numberPicker.setValue(1);
                iArr[0] = 0;
                iArr2[0] = 30;
                iArr3[0] = 0;
            }
        });
        textView6.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                MainActivity.this.changeValueByOne(numberPicker3, false);
                MainActivity.this.changeValueByOne(numberPicker2, false);
                MainActivity.this.changeValueByOne(numberPicker, false);
                numberPicker3.setValue(1);
                numberPicker2.setValue(1);
                numberPicker.setValue(2);
                iArr[0] = 1;
                iArr2[0] = 0;
                iArr3[0] = 0;
            }
        });
        numberPicker.setOnValueChangedListener(new NumberPicker.OnValueChangeListener() {
            @Override
            public void onValueChange(NumberPicker numberPicker4, int i, int i2) {
                iArr[0] = i2;
            }
        });
        numberPicker2.setOnValueChangedListener(new NumberPicker.OnValueChangeListener() {
            @Override
            public void onValueChange(NumberPicker numberPicker4, int i, int i2) {
                iArr2[0] = i2;
            }
        });
        numberPicker3.setOnValueChangedListener(new NumberPicker.OnValueChangeListener() {
            @Override
            public void onValueChange(NumberPicker numberPicker4, int i, int i2) {
                iArr3[0] = i2;
            }
        });
        builder.setPositiveButton(getResources().getString(R.string.Yes), new DialogInterface.OnClickListener() {
            @Override
            public void onClick(DialogInterface dialogInterface, int i) {
                if (MainActivity.this.count != null) {
                    MainActivity.this.count.cancel();
                }
                final long j = (iArr[0] * 3600000) + (iArr2[0] * 60000) + (iArr3[0] * 1000);
                if (j == 0) {
                    PToast.showT(MainActivity.this, "Invalid Timer");
                    return;
                }
                MainActivity.this.CloseTimer.setVisibility(0);
                MainActivity.this.CloseTimer.startAnimation(MainActivity.closeTimerAnimation);
                LoadAdClass2.LoadIAd(MainActivity.this);
                MainActivity.this.count = new CountDownTimer(j, 1000L) {
                    @Override
                    public void onTick(long j2) {
                        MainActivity.this.TimerprogressBar1.setProgress((int) ((100 * j2) / j));
                        long j3 = (j2 / 3600000) % 24;
                        long j4 = (j2 / 60000) % 60;
                        long j5 = (j2 / 1000) % 60;
                        if (j3 != 0) {
                            MainActivity.this.Timer.setText(MainActivity.this.df_Count.format(j3) + " : " + MainActivity.this.df_Count.format(j4) + " : " + MainActivity.this.df_Count.format(j5));
                        }
                        if (j3 == 0) {
                            MainActivity.this.Timer.setText(MainActivity.this.df_Count.format(j4) + " : " + MainActivity.this.df_Count.format(j5));
                        }
                    }

                    @Override
                    public void onFinish() {
                        MainActivity.this.stopTimer();
                    }
                }.start();
            }
        });
        builder.setNegativeButton(getResources().getString(R.string.No), new DialogInterface.OnClickListener() {
            @Override
            public void onClick(DialogInterface dialogInterface, int i) {
                dialogInterface.cancel();
            }
        });
        builder.create().show();
    }

    public void changeValueByOne(NumberPicker numberPicker, boolean z) {
        try {
            Method declaredMethod = numberPicker.getClass().getDeclaredMethod("changeValueByOne", Boolean.TYPE);
            declaredMethod.setAccessible(true);
            declaredMethod.invoke(numberPicker, Boolean.valueOf(z));
        } catch (IllegalAccessException e) {
            e.printStackTrace();
        } catch (IllegalArgumentException e2) {
            e2.printStackTrace();
        } catch (NoSuchMethodException e3) {
            e3.printStackTrace();
        } catch (InvocationTargetException e4) {
            e4.printStackTrace();
        }
    }

    public void increaseCounter() {
        if (!this.isSound || this.isCompleted) {
            long j = counter + 1;
            counter = j;
            graph_counter++;
            AppCounter++;
            if (!this.isPhotomode && !this.isVideomode) {
                this.numbers.setText(this.df_big.format(j));
            } else {
                this.numbers.setText(this.df_photo.format(j));
            }
            this.numbers2.setText(this.df_big.format(counter));
            this.counterText.setText(this.df_Count.format(counter));
            setVib(EMachine.EM_M32C);
            playTik();
            if (isGroup) {
                long parseLong = Long.parseLong(PSharedPreference.getString(this, GroupConst.Grptarget, "0"));
                if (0 != parseLong) {
                    changeProgressBar(this.progress_Bar, (int) ((counter * 100) / parseLong));
                }
                StoredataintoDatabase();
                if (counter >= parseLong) {
                    changeProgressBar(this.progress_Bar, 100);
                    this.tgt_rounds.setText(this.df_target_round.format(0L));
                    counter = 0L;
                    if (this.isPhotomode || this.isVideomode) {
                        this.numbers.setText(this.df_photo.format(0L));
                    } else {
                        this.numbers.setText(this.df_big.format(0L));
                    }
                    this.numbers2.setText(this.df_big.format(counter));
                    setVib(LogSeverity.CRITICAL_VALUE);
                    TargetDialogClass targetDialogClass = new TargetDialogClass(this, isGroup);
                    targetDialogClass.setCancelable(false);
                    targetDialogClass.show();
                    if (this.isSound) {
                        MediaPlayer create = MediaPlayer.create((Context) this, R.raw.target);
                        this.mp2 = create;
                        create.setOnCompletionListener(new MediaPlayer.OnCompletionListener() {
                            @Override
                            public void onCompletion(MediaPlayer mediaPlayer) {
                            }
                        });
                        this.mp2.start();
                        return;
                    }
                    return;
                }
                return;
            }
            long j2 = PSharedPreference.getLong(this, "TGT", 0L);
            if (0 != j2) {
                changeProgressBar(this.progress_Bar, (int) ((counter * 100) / j2));
            }
            if (j2 == 0 || counter < j2) {
                return;
            }
            changeProgressBar(this.progress_Bar, 100);
            PSharedPreference.setLong(this, "ROUND", PSharedPreference.getLong(this, "ROUND", 0L) + 1);
            long j3 = PSharedPreference.getLong(this, "ROUND", 0L);
            this.tgt_rounds.setText(this.df_target_round.format(j3));
            UpdateDb.UpdateRound(this, j3);
            counter = 0L;
            PSharedPreference.setLong(this, "NUMBER", 0L);
            if (this.isPhotomode || this.isVideomode) {
                this.numbers.setText(this.df_photo.format(counter));
            } else {
                this.numbers.setText(this.df_big.format(counter));
            }
            this.numbers2.setText(this.df_big.format(counter));
            setVib(LogSeverity.CRITICAL_VALUE);
            if (PSharedPreference.getBoolean(this, "IS_Target_mode", true) || this.Timer.getText().toString().equals("Timer")) {
                TargetDialogClass targetDialogClass2 = new TargetDialogClass(this, isGroup);
                targetDialogClass2.setCancelable(false);
                targetDialogClass2.show();
            }
            if (this.isSound) {
                MediaPlayer create2 = MediaPlayer.create((Context) this, R.raw.target);
                this.mp2 = create2;
                create2.setOnCompletionListener(new MediaPlayer.OnCompletionListener() {
                    @Override
                    public void onCompletion(MediaPlayer mediaPlayer) {
                    }
                });
                this.mp2.start();
            }
        }
    }

    public void changeProgressBar(ProgressBar progressBar, int i) {
        ProgressbarAnimation progressbarAnimation = new ProgressbarAnimation(progressBar, progressBar.getProgress(), i);
        progressbarAnimation.setDuration(150L);
        progressBar.startAnimation(progressbarAnimation);
        this.ProgressText.setText(i + " %");
    }

    public void onRequestPermissionsResult(int i, String[] strArr, int[] iArr) {
        super.onRequestPermissionsResult(i, strArr, iArr);
        if (Build.VERSION.SDK_INT >= 33 || i != 101) {
            return;
        }
        if (iArr.length > 0 && iArr[0] == 0) {
            this.extfileplay.performClick();
            return;
        }
        AlertDialog.Builder builder = new AlertDialog.Builder(this);
        builder.setMessage(getResources().getString(R.string.permission_msg));
        builder.setPositiveButton(getResources().getString(R.string.Yes), new DialogInterface.OnClickListener() {
            @Override
            public void onClick(DialogInterface dialogInterface, int i2) {
                Intent intent = new Intent();
                intent.setAction("android.settings.APPLICATION_DETAILS_SETTINGS");
                intent.setData(Uri.fromParts("package", MainActivity.this.getPackageName(), null));
                MainActivity.this.startActivity(intent);
            }
        });
        builder.setNegativeButton(getResources().getString(R.string.No), new DialogInterface.OnClickListener() {
            @Override
            public void onClick(DialogInterface dialogInterface, int i2) {
            }
        });
        builder.create();
        builder.show();
    }

    public boolean isMediaPlayerPlaying() {
        MediaPlayer mediaPlayer = this.bgMediaPlayer;
        return mediaPlayer != null && mediaPlayer.isPlaying();
    }

    public void setVib(int i) {
        if (this.isvib) {
            Vibrator vibrator = (Vibrator) getSystemService("vibrator");
            if (Build.VERSION.SDK_INT >= 26) {
                ReminderCreateDialog$7$.ExternalSyntheticApiModelOutline0.m(vibrator, ReminderCreateDialog$7$.ExternalSyntheticApiModelOutline0.m(i, -1));
            } else {
                vibrator.vibrate(i);
            }
        }
    }

    public void setBackground(RelativeLayout relativeLayout, boolean z) {
        switch (PSharedPreference.getInteger(this, "BACKGROUND_WALL", 1)) {
            case 1:
                relativeLayout.setBackgroundResource(R.drawable.wall);
                break;
            case 2:
                relativeLayout.setBackgroundResource(R.drawable.wall1);
                break;
            case 3:
                relativeLayout.setBackgroundResource(R.drawable.test);
                break;
            case 4:
                relativeLayout.setBackgroundResource(R.drawable.wall3);
                break;
            case 5:
                relativeLayout.setBackgroundResource(R.drawable.wall4);
                break;
            case 6:
                relativeLayout.setBackgroundResource(R.drawable.wall5);
                break;
        }
        if (z) {
            themeLayout.startAnimation(fadeout);
        }
    }

    public void setRed(boolean z) {
        this.mainUpper.setImageResource(R.drawable.red_upper);
        this.mainLower.setImageResource(R.drawable.red_lower);
        PStatusBar.changeColor(getWindow(), Color.parseColor("#ff4141"));
        if (!isGroup) {
            PSharedPreference.setInteger(this, "THEMES", 1);
        }
        if (z) {
            setBackground(this.Background, false);
        }
        this.numbers.setTextColor(RoundedDrawable.DEFAULT_BORDER_COLOR);
        this.progress_Bar.setProgressTintList(ColorStateList.valueOf(Color.parseColor("#e60b37")));
    }

    public void setLavender(boolean z) {
        this.mainUpper.setImageResource(R.drawable.lavender_upper);
        this.mainLower.setImageResource(R.drawable.lavender_lower);
        PStatusBar.changeColor(getWindow(), Color.parseColor("#54085f"));
        if (!isGroup) {
            PSharedPreference.setInteger(this, "THEMES", 3);
        }
        if (z) {
            setBackground(this.Background, false);
        }
        this.numbers.setTextColor(RoundedDrawable.DEFAULT_BORDER_COLOR);
        this.progress_Bar.setProgressTintList(ColorStateList.valueOf(Color.parseColor("#b304cc")));
    }

    public void setBlue(boolean z) {
        this.mainUpper.setImageResource(R.drawable.blue_upper);
        this.mainLower.setImageResource(R.drawable.blue_lower);
        PStatusBar.changeColor(getWindow(), -16776961);
        if (z) {
            setBackground(this.Background, false);
        }
        if (!isGroup) {
            PSharedPreference.setInteger(this, "THEMES", 2);
        }
        this.numbers.setTextColor(RoundedDrawable.DEFAULT_BORDER_COLOR);
        this.progress_Bar.setProgressTintList(ColorStateList.valueOf(Color.parseColor("#129ce0")));
    }

    public void setGolden(boolean z) {
        this.mainUpper.setImageResource(R.drawable.golden_upper);
        this.mainLower.setImageResource(R.drawable.golden_lower);
        PStatusBar.changeColor(getWindow(), Color.parseColor("#000000"));
        if (!isGroup) {
            PSharedPreference.setInteger(this, "THEMES", 6);
        }
        if (z) {
            this.Background.setBackgroundResource(R.drawable.test);
        }
        this.numbers.setTextColor(RoundedDrawable.DEFAULT_BORDER_COLOR);
        this.progress_Bar.setProgressTintList(ColorStateList.valueOf(Color.parseColor("#e60b37")));
    }

    public void setOrange(boolean z) {
        this.mainUpper.setImageResource(R.drawable.orange_upper);
        this.mainLower.setImageResource(R.drawable.orange_lower);
        if (!isGroup) {
            PSharedPreference.setInteger(this, "THEMES", 5);
        }
        PStatusBar.changeColor(getWindow(), ContextCompat.getColor(this, R.color.orangeFontColor));
        if (z) {
            setBackground(this.Background, false);
        }
        this.numbers.setTextColor(RoundedDrawable.DEFAULT_BORDER_COLOR);
        this.progress_Bar.setProgressTintList(ColorStateList.valueOf(Color.parseColor("#f78800")));
    }

    public void setDark(boolean z) {
        this.mainUpper.setImageResource(R.drawable.black_upper);
        this.mainLower.setImageResource(R.drawable.black_lower);
        if (!isGroup) {
            PSharedPreference.setInteger(this, "THEMES", 4);
        }
        PStatusBar.changeColor(getWindow(), RoundedDrawable.DEFAULT_BORDER_COLOR);
        if (z) {
            this.Background.setBackgroundResource(R.drawable.wall_dark);
        }
        this.numbers.setTextColor(RoundedDrawable.DEFAULT_BORDER_COLOR);
        this.progress_Bar.setProgressTintList(ColorStateList.valueOf(-3355444));
    }

    public void playTik() {
        if (this.isSound && this.isCompleted && this.isPrepare) {
            this.isCompleted = false;
            this.mp1.start();
        }
    }

    public void playBell() {
        try {
            this.mpbell.reset();
            AssetFileDescriptor openFd = getAssets().openFd("bell.mp3");
            this.mpbell.setDataSource(openFd.getFileDescriptor(), openFd.getStartOffset(), openFd.getLength());
            this.mpbell.prepare();
            this.mpbell.start();
        } catch (IOException e) {
            e.printStackTrace();
        }
    }

    public class TargetDialogClass extends Dialog {
        RelativeLayout Dialog_bg;
        public TextView Title_TargetDialog;
        public TextView TotalMantra;
        public Activity c;
        AnimationDrawable congoD;
        ImageView congoGif;
        public Dialog d;
        boolean isGroup;
        public TextView no;
        public TextView stopTitle;
        RelativeLayout totalLayout;
        public TextView yes;

        public TargetDialogClass(Activity activity, boolean z) {
            super(activity);
            this.c = activity;
            this.isGroup = z;
        }

        @Override
        protected void onCreate(Bundle bundle) {
            super.onCreate(bundle);
            requestWindowFeature(1);
            setContentView(R.layout.congo_dialog);
            MainActivity.isStartAutoChanting = false;
            MainActivity.this.getOnBackPressedDispatcher().addCallback(MainActivity.this, new OnBackPressedCallback(true) {
                public void handleOnBackPressed() {
                    ExitNativeAds.showExitDialog(MainActivity.this);
                }
            });
            MainActivity.this.stopAutoChanting();
            MainActivity.setLanguage(this.c);
            MainActivity.this.StoredataintoDatabase();
            MainActivity.this.StoreTotalonServer(MainActivity.AppCounter, Settings.getAppVersion(MainActivity.this));
            this.Dialog_bg = (RelativeLayout) findViewById(R.id.dialog_bg);
            this.yes = (TextView) findViewById(R.id.btn_yes);
            this.no = (TextView) findViewById(R.id.btn_no);
            this.TotalMantra = (TextView) findViewById(R.id.totalMantra);
            this.Title_TargetDialog = (TextView) findViewById(R.id.txt_dia);
            this.totalLayout = (RelativeLayout) findViewById(R.id.totalLayout);
            this.stopTitle = (TextView) findViewById(R.id.stoptitle);
            this.TotalMantra.setVisibility(0);
            if (PSharedPreference.getString(MainActivity.this, "U_total", "null").equals("null")) {
                this.TotalMantra.setText(MainActivity.AppCounter + "");
            } else {
                this.TotalMantra.setText(PSharedPreference.getString(MainActivity.this, "U_total", "null"));
            }
            this.congoGif = (ImageView) findViewById(R.id.congogif);
            if (this.isGroup) {
                this.stopTitle.setVisibility(0);
                this.no.setVisibility(0);
                this.Title_TargetDialog.setText(MainActivity.this.GRPName + HelpFormatter.DEFAULT_LONG_OPT_SEPARATOR + MainActivity.this.getResources().getString(R.string.Congo_group));
                this.congoGif.setBackgroundResource(R.drawable.completed);
            } else {
                this.stopTitle.setVisibility(8);
                this.no.setVisibility(8);
                this.Title_TargetDialog.setText(MainActivity.this.getResources().getString(R.string.Congo_local));
                this.congoGif.setBackgroundResource(R.drawable.congo_animation);
                AnimationDrawable animationDrawable = (AnimationDrawable) this.congoGif.getBackground();
                this.congoD = animationDrawable;
                animationDrawable.start();
            }
            this.yes.setOnClickListener(new View.OnClickListener() {
                @Override
                public void onClick(View view) {
                    if (TargetDialogClass.this.isGroup) {
                        MainActivity.this.setActiveGroupDataLable(MainActivity.this.GRPName, true);
                        MainActivity.this.StopGroupChantingFeature();
                    }
                    LoadAdClass2.showIAd(MainActivity.this);
                    MainActivity.this.changeProgressBar(MainActivity.this.progress_Bar, 0);
                    TargetDialogClass.this.dismiss();
                }
            });
            this.no.setOnClickListener(new View.OnClickListener() {
                @Override
                public void onClick(View view) {
                    TargetDialogClass.this.dismiss();
                }
            });
        }
    }

    public void StoreTotalonServer(long j, String str) {
        if (!U_Gmail.equals("null")) {
            UserWebService.updateTotalMala(this, j + "", str, U_Gmail);
            return;
        }
        UserWebService.updateTotalMala(this, graph_counter + "", str, PSharedPreference.getString(this, "TOKEN_ID", "No_Token_Found"));
    }
}