正在查看: Surah Shiksha v1.0.6 应用的 DashboardActivity.java JAVA 源代码文件
本页面展示 JAVA 反编译生成的源代码文件,支持语法高亮显示。 仅供安全研究与技术分析使用,严禁用于任何非法用途。请遵守相关法律法规。
正在查看: Surah Shiksha v1.0.6 应用的 DashboardActivity.java JAVA 源代码文件
本页面展示 JAVA 反编译生成的源代码文件,支持语法高亮显示。 仅供安全研究与技术分析使用,严禁用于任何非法用途。请遵守相关法律法规。
package com.shahriar.surahshikkha.UI;
import A.q;
import A0.d;
import L0.h;
import Q0.a;
import Q0.b;
import Q0.c;
import android.content.Context;
import android.content.Intent;
import android.content.res.Configuration;
import android.graphics.Typeface;
import android.graphics.drawable.Drawable;
import android.media.MediaPlayer;
import android.os.Bundle;
import android.os.Handler;
import android.text.SpannableString;
import android.text.style.ForegroundColorSpan;
import android.util.Log;
import android.view.Menu;
import android.view.MenuItem;
import android.view.SubMenu;
import android.view.View;
import android.widget.ImageView;
import android.widget.ProgressBar;
import android.widget.TextView;
import androidx.activity.j;
import androidx.appcompat.widget.SearchView;
import androidx.appcompat.widget.SwitchCompat;
import androidx.appcompat.widget.Toolbar;
import androidx.drawerlayout.widget.DrawerLayout;
import androidx.recyclerview.widget.RecyclerView;
import com.google.android.material.navigation.NavigationView;
import com.shahriar.surahshikkha.LayoutManager.ScrollingLinearLayoutManager;
import com.shahriar.surahshikkha.R;
import e.AbstractActivityC0110n;
import j0.C0244o;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.Locale;
import k.InterfaceC0298j1;
public class DashboardActivity extends AbstractActivityC0110n implements View.OnClickListener, d, InterfaceC0298j1, b, a, c {
public static N0.c f2451T;
public static int f2452U;
public Typeface f2453A;
public Context f2454B;
public P0.a f2455C;
public V0.a f2456D;
public int f2457E;
public Handler f2458F;
public DrawerLayout f2463K;
public ScrollingLinearLayoutManager f2464L;
public h f2466N;
public SwitchCompat f2467O;
public SwitchCompat f2468P;
public TextView f2469Q;
public TextView f2470R;
public ArrayList f2471S;
public SearchView f2472y;
public MenuItem f2473z;
public final T0.b f2459G = new T0.b(0);
public final T0.b f2460H = new T0.b(1);
public final T0.b f2461I = new T0.b(2);
public final T0.a f2462J = new T0.a(this, 2);
public final j f2465M = new j(15, this);
public final void A(N0.c cVar, int i2) {
V0.a aVar = this.f2456D;
if (aVar == null || cVar == null) {
return;
}
int i3 = aVar.f898c;
MediaPlayer mediaPlayer = aVar.f896a;
int currentPosition = ((mediaPlayer != null ? mediaPlayer.getCurrentPosition() : 0) * 100) / i3;
cVar.f730f = currentPosition;
View q2 = this.f2464L.q(i2);
if (q2 != null) {
((ProgressBar) q2.findViewById(R.id.playProgressBar)).setProgress(currentPosition);
}
this.f2458F.postDelayed(this.f2465M, 1000L);
}
public final void B(Context context) {
Log.d(getClass().getSimpleName(), "updateTitleBar");
SpannableString spannableString = new SpannableString(context.getString(R.string.app_name));
spannableString.setSpan(new M0.a(this.f2453A), 0, spannableString.length(), 34);
setTitle(spannableString);
}
@Override
public final void attachBaseContext(Context context) {
super.attachBaseContext(U0.b.i(context));
}
public final void n(MenuItem menuItem) {
Log.d(getClass().getSimpleName(), "applyFontToMenuItem");
SpannableString spannableString = new SpannableString(menuItem.getTitle());
spannableString.setSpan(new M0.a(this.f2453A), 0, spannableString.length(), 18);
spannableString.setSpan(new ForegroundColorSpan(getResources().getColor(R.color.colorBlack)), 0, spannableString.length(), 0);
menuItem.setTitle(spannableString);
}
public final void o(int i2, boolean z2) {
Log.d(getClass().getSimpleName(), "audioFinished");
V0.a aVar = this.f2456D;
if (aVar != null) {
aVar.f896a.release();
aVar.f897b.abandonAudioFocus(aVar);
this.f2456D = null;
}
Log.d(getClass().getSimpleName(), "surah number " + i2 + " surah info " + f2451T.toString());
N0.c cVar = f2451T;
cVar.f730f = 0;
cVar.f731g = false;
if (this.f2466N != null) {
if (z2) {
Log.d("UpdateListener ", "UpdateListener, User Initiated");
this.f2466N.g(f2452U, f2451T, null);
} else {
Log.d("UpdateListener ", "UpdateListener, Not user Initiated");
this.f2466N.g(f2452U, f2451T, this);
}
}
}
@Override
public final void onBackPressed() {
Log.d(getClass().getSimpleName(), "onBackPressed");
View e2 = this.f2463K.e(8388611);
if (e2 != null && DrawerLayout.m(e2)) {
this.f2463K.d(false);
return;
}
String string = this.f2454B.getString(R.string.exit);
String string2 = this.f2454B.getString(R.string.cancel);
String string3 = this.f2454B.getString(R.string.exit_text);
O0.b bVar = new O0.b(this, R.style.AlertDialogTheme);
bVar.f747e = this.f2462J;
bVar.f743a = this;
bVar.f745c = string2;
bVar.f744b = string;
bVar.f746d = string3;
bVar.show();
}
@Override
public void onClick(View view) {
Log.d(getClass().getSimpleName(), "onClick");
if (view.getId() != R.id.language_control) {
return;
}
this.f2463K.d(false);
w();
}
@Override
public final void onConfigurationChanged(Configuration configuration) {
super.onConfigurationChanged(configuration);
t(this);
}
@Override
public final void onCreate(Bundle bundle) {
super.onCreate(bundle);
Log.d(getClass().getSimpleName(), "onCreate");
setContentView(R.layout.drawer_layout);
this.f2454B = this;
this.f2455C = new P0.a(this);
this.f2453A = q.b(this, R.font.solaimanlipi);
t(this.f2454B);
Intent intent = getIntent();
if ("android.intent.action.SEARCH".equals(intent.getAction())) {
String stringExtra = intent.getStringExtra("query");
Log.d(getClass().getSimpleName(), "OnCreate " + stringExtra);
} else {
r();
}
this.f2457E = 0;
f2452U = 0;
}
@Override
public final boolean onCreateOptionsMenu(Menu menu) {
Log.d(getClass().getSimpleName(), "onCreateOptionsMenu");
getMenuInflater().inflate(R.menu.dashboard_activity_action_bar_items, menu);
Log.d(getClass().getSimpleName(), "initializeMenuItem()");
this.f2463K = (DrawerLayout) findViewById(R.id.drawer_layout);
NavigationView navigationView = (NavigationView) findViewById(R.id.nav_view);
navigationView.setNavigationItemSelectedListener(this);
Log.d(getClass().getSimpleName(), "initializeMenuItem setNavigationItemSelectedListener");
this.f2463K.a(new A0.c(this));
Log.d(getClass().getSimpleName(), "initComponent Menu");
Menu menu2 = navigationView.getMenu();
MenuItem findItem = menu2.findItem(R.id.english_verse_translation);
findItem.setTitle(this.f2454B.getString(R.string.menu_english_translation));
this.f2468P = (SwitchCompat) findItem.getActionView().findViewById(R.id.switcher);
this.f2468P.setChecked(this.f2455C.c("english_translation", true));
this.f2468P.setOnClickListener(new T0.c(this, 0));
MenuItem findItem2 = menu2.findItem(R.id.bangla_verse_translation);
this.f2467O = (SwitchCompat) findItem2.getActionView().findViewById(R.id.switcher);
findItem2.setTitle(this.f2454B.getString(R.string.menu_bangla_translation));
this.f2467O.setChecked(this.f2455C.c("bangla_translation", true));
this.f2467O.setOnClickListener(new T0.c(this, 1));
Locale a2 = C0244o.a(this);
Log.d(getClass().getSimpleName(), "initComponent drawerMaxRepeatCount");
MenuItem findItem3 = menu2.findItem(R.id.max_loop_count_control);
findItem3.setTitle(this.f2454B.getString(R.string.max_repeat_count));
TextView textView = (TextView) findItem3.getActionView().findViewById(R.id.menu_max_repeat_count);
this.f2469Q = textView;
textView.setTypeface(this.f2453A);
int i2 = this.f2455C.b().getInt("max_repeat_count", -1);
if (i2 == -1) {
this.f2455C.f("max_repeat_count", 3);
i2 = 3;
}
this.f2469Q.setText(C0244o.d(i2, a2));
this.f2469Q.setOnClickListener(new T0.c(this, 2));
MenuItem findItem4 = menu2.findItem(R.id.languageControl);
findItem4.setTitle(this.f2454B.getString(R.string.language_control));
TextView textView2 = (TextView) findItem4.getActionView().findViewById(R.id.language_control);
this.f2470R = textView2;
textView2.setTypeface(this.f2453A);
int i3 = this.f2455C.b().getInt("language", -1);
if (i3 == -1) {
if ("bn".equals(a2.getLanguage())) {
this.f2455C.f("language", 1);
i3 = 1;
} else {
this.f2455C.f("language", 0);
i3 = 0;
}
}
this.f2470R.setText(i3 == 1 ? "বাংলা" : "English");
this.f2470R.setOnClickListener(this);
menu2.findItem(R.id.rateUs).setTitle(this.f2454B.getString(R.string.rate_us));
Log.d(getClass().getSimpleName(), "rate app");
menu2.findItem(R.id.userGuide).setTitle(this.f2454B.getString(R.string.user_guide));
menu2.findItem(R.id.menu_item_share).setTitle(this.f2454B.getString(R.string.menu_share));
menu2.findItem(R.id.menu_item_control).setTitle(this.f2454B.getString(R.string.menu_control));
menu2.findItem(R.id.menu_item_communicate).setTitle(this.f2454B.getString(R.string.menu_communicate));
Menu menu3 = navigationView.getMenu();
for (int i4 = 0; i4 < menu3.size(); i4++) {
MenuItem item = menu3.getItem(i4);
SubMenu subMenu = item.getSubMenu();
if (subMenu != null && subMenu.size() > 0) {
for (int i5 = 0; i5 < subMenu.size(); i5++) {
n(subMenu.getItem(i5));
}
}
n(item);
}
ImageView imageView = (ImageView) findViewById(R.id.drawer_header_image);
Drawable drawable = this.f2454B.getResources().getDrawable(R.drawable.splash_surah_shiksha);
if (imageView == null || drawable == null) {
Log.i("DashboardActivity", "Image and header is null");
} else {
Log.i("DashboardActivity", "Image and header is not null");
imageView.setBackground(drawable);
}
MenuItem findItem5 = menu.findItem(R.id.search);
this.f2473z = findItem5;
SearchView searchView = (SearchView) findItem5.getActionView();
this.f2472y = searchView;
searchView.setIconifiedByDefault(false);
this.f2472y.setOnQueryTextListener(this);
this.f2472y.setQueryHint(this.f2454B.getResources().getString(R.string.search_hint));
return true;
}
@Override
public final void onDestroy() {
super.onDestroy();
Log.d(getClass().getSimpleName(), "onDestroy");
V0.a aVar = this.f2456D;
if (aVar != null) {
aVar.f896a.release();
aVar.f897b.abandonAudioFocus(aVar);
}
this.f2458F.removeCallbacks(this.f2465M);
f2451T = null;
f2452U = 0;
Log.d(getClass().getSimpleName(), "On destroy called");
}
@Override
public final boolean onOptionsItemSelected(MenuItem menuItem) {
Log.d(getClass().getSimpleName(), "onOptionsItemSelected");
int itemId = menuItem.getItemId();
int i2 = 1;
if (itemId == 16908332) {
DrawerLayout drawerLayout = this.f2463K;
View e2 = drawerLayout.e(8388611);
if (e2 != null) {
drawerLayout.p(e2);
return true;
}
throw new IllegalArgumentException("No drawer view found with gravity " + DrawerLayout.j(8388611));
}
if (itemId != R.id.actionSort) {
return super.onOptionsItemSelected(menuItem);
}
z();
r();
Log.d(getClass().getSimpleName(), "showSortSelectDialog");
O0.d dVar = new O0.d(this, this.f2454B.getString(R.string.sort), this.f2454B.getString(R.string.cancel), new ArrayList(Arrays.asList(this.f2454B.getResources().getStringArray(R.array.sort_array))), this.f2455C.d("sort", 0), new T0.a(this, i2), 1);
dVar.requestWindowFeature(1);
dVar.show();
return true;
}
@Override
public final void onResume() {
super.onResume();
Log.d(getClass().getSimpleName(), "onResume");
v(f2452U);
}
public final void p() {
Log.d(getClass().getSimpleName(), "audioPaused");
MediaPlayer mediaPlayer = this.f2456D.f896a;
if (mediaPlayer == null || !mediaPlayer.isPlaying()) {
return;
}
this.f2456D.a();
f2451T.f731g = false;
}
public final void q() {
Log.d(getClass().getSimpleName(), "closeDrawer");
DrawerLayout drawerLayout = (DrawerLayout) findViewById(R.id.drawer_layout);
View e2 = drawerLayout.e(8388611);
if (e2 != null) {
drawerLayout.c(e2, true);
this.f2463K.d(false);
} else {
throw new IllegalArgumentException("No drawer view found with gravity " + DrawerLayout.j(8388611));
}
}
public final void r() {
Log.d(getClass().getSimpleName(), "closeSearchBar");
SearchView searchView = this.f2472y;
if (searchView == null || !searchView.isShown()) {
return;
}
this.f2473z.collapseActionView();
this.f2472y.t();
}
public final ArrayList s(Context context) {
Log.d(getClass().getSimpleName(), "getSurahInfoList");
ArrayList arrayList = new ArrayList();
arrayList.add(new N0.c(1, 46080, 7, context.getString(R.string.surah_al_fatihah), context.getString(R.string.bn_surah_al_fatihah)));
arrayList.add(new N0.c(86, 100656, 17, context.getString(R.string.surah_at_tariq), context.getString(R.string.bn_surah_at_tariq)));
arrayList.add(new N0.c(87, 108216, 19, context.getString(R.string.surah_al_ala), context.getString(R.string.bn_surah_al_ala)));
arrayList.add(new N0.c(88, 134568, 26, context.getString(R.string.surah_al_ghashiyah), context.getString(R.string.bn_surah_al_ghashiyah)));
arrayList.add(new N0.c(89, 213408, 30, context.getString(R.string.surah_al_fajr), context.getString(R.string.bn_surah_al_fajr)));
arrayList.add(new N0.c(90, 120456, 20, context.getString(R.string.surah_al_balad), context.getString(R.string.bn_surah_al_balad)));
arrayList.add(new N0.c(91, 84816, 15, context.getString(R.string.surah_ash_shams), context.getString(R.string.bn_surah_ash_shams)));
arrayList.add(new N0.c(92, 112032, 21, context.getString(R.string.surah_al_layl), context.getString(R.string.bn_surah_al_layl)));
arrayList.add(new N0.c(93, 65304, 11, context.getString(R.string.surah_ad_duha), context.getString(R.string.bn_surah_ad_duha)));
arrayList.add(new N0.c(94, 43200, 8, context.getString(R.string.surah_as_sharh), context.getString(R.string.bn_surah_as_sharh)));
arrayList.add(new N0.c(95, 65160, 8, context.getString(R.string.surah_at_tin), context.getString(R.string.bn_surah_at_tin)));
arrayList.add(new N0.c(97, 45360, 5, context.getString(R.string.surah_al_qadr), context.getString(R.string.bn_surah_al_qadr)));
arrayList.add(new N0.c(98, 126648, 8, context.getString(R.string.surah_al_bayyinah), context.getString(R.string.bn_surah_al_bayyinah)));
arrayList.add(new N0.c(99, 60192, 8, context.getString(R.string.surah_az_zilzalah), context.getString(R.string.bn_surah_az_zilzalah)));
arrayList.add(new N0.c(100, 70272, 11, context.getString(R.string.surah_al_adiyat), context.getString(R.string.bn_surah_al_adiyat)));
arrayList.add(new N0.c(101, 62784, 11, context.getString(R.string.surah_al_qariah), context.getString(R.string.bn_surah_al_qariah)));
arrayList.add(new N0.c(102, 62856, 8, context.getString(R.string.surah_at_takathur), context.getString(R.string.bn_surah_at_takathur)));
arrayList.add(new N0.c(103, 27648, 3, context.getString(R.string.surah_al_asr), context.getString(R.string.bn_surah_al_asr)));
arrayList.add(new N0.c(104, 58248, 9, context.getString(R.string.surah_al_humazah), context.getString(R.string.bn_surah_al_humazah)));
arrayList.add(new N0.c(105, 49176, 5, context.getString(R.string.surah_al_fil), context.getString(R.string.bn_surah_al_fil)));
arrayList.add(new N0.c(106, 42768, 4, context.getString(R.string.surah_quraysh), context.getString(R.string.bn_surah_quraysh)));
arrayList.add(new N0.c(107, 57744, 7, context.getString(R.string.surah_al_maun), context.getString(R.string.bn_surah_al_maun)));
arrayList.add(new N0.c(108, 24768, 3, context.getString(R.string.surah_al_kawthar), context.getString(R.string.bn_surah_al_kawthar)));
arrayList.add(new N0.c(109, 54504, 6, context.getString(R.string.surah_al_kafirun), context.getString(R.string.bn_surah_al_kafirun)));
arrayList.add(new N0.c(110, 35136, 3, context.getString(R.string.surah_an_nasr), context.getString(R.string.bn_surah_an_nasr)));
arrayList.add(new N0.c(111, 41760, 5, context.getString(R.string.surah_al_masad), context.getString(R.string.bn_surah_al_masad)));
arrayList.add(new N0.c(112, 22104, 4, context.getString(R.string.surah_al_ikhlas), context.getString(R.string.bn_surah_al_ikhlas)));
arrayList.add(new N0.c(113, 33264, 5, context.getString(R.string.surah_al_falaq), context.getString(R.string.bn_surah_al_falaq)));
arrayList.add(new N0.c(114, 50256, 6, context.getString(R.string.surah_an_nas), context.getString(R.string.bn_surah_an_nas)));
return arrayList;
}
public final void t(Context context) {
Log.d(getClass().getSimpleName(), "initComponent");
m((Toolbar) findViewById(R.id.toolbar));
E.a k2 = k();
if (k2 != null) {
Log.d(getClass().getSimpleName(), "setSupportActionBar");
k2.P1(2131231218);
k2.M1(true);
}
B(context);
this.f2458F = new Handler();
Log.d(getClass().getSimpleName(), "setHomeAsUpIndicator");
RecyclerView recyclerView = (RecyclerView) findViewById(R.id.surahList);
recyclerView.setHasFixedSize(true);
ScrollingLinearLayoutManager scrollingLinearLayoutManager = new ScrollingLinearLayoutManager(1);
this.f2464L = scrollingLinearLayoutManager;
recyclerView.setLayoutManager(scrollingLinearLayoutManager);
this.f2471S = s(context);
int d2 = this.f2455C.d("sort", 0);
Log.d(getClass().getSimpleName(), "sortList");
y(d2);
this.f2466N = new h(this.f2471S, context, this);
Log.d(getClass().getSimpleName(), "SurahListAdapter");
recyclerView.setAdapter(this.f2466N);
Log.d(getClass().getSimpleName(), "setAdapter");
}
public final void u(N0.c cVar, int i2) {
MediaPlayer mediaPlayer;
MediaPlayer mediaPlayer2;
Log.d(getClass().getSimpleName(), "playPauseButtonPressed " + i2 + " isPlaying " + cVar.f731g + " surahInfo " + cVar.f727c);
if (this.f2456D != null) {
if (cVar.f727c != this.f2457E) {
z();
this.f2456D = new V0.a(this, C0244o.f(cVar.f727c), this, cVar.f727c);
}
mediaPlayer = this.f2456D.f896a;
if (mediaPlayer == null && mediaPlayer.isPlaying()) {
Log.i(getClass().getSimpleName(), "Media is playing, stop the media");
this.f2456D.a();
return;
}
Log.i(getClass().getSimpleName(), "Media is not playing, start the media and update progressbar");
V0.a aVar = this.f2456D;
mediaPlayer2 = aVar.f896a;
if (mediaPlayer2 != null) {
mediaPlayer2.start();
a aVar2 = aVar.f900e;
if (aVar2 != null) {
DashboardActivity dashboardActivity = (DashboardActivity) aVar2;
Log.d(dashboardActivity.getClass().getSimpleName(), "audioStarted");
dashboardActivity.f2458F.postDelayed(dashboardActivity.f2465M, 1000L);
}
}
A(cVar, i2);
}
this.f2456D = new V0.a(this, C0244o.f(cVar.f727c), this, cVar.f727c);
this.f2457E = cVar.f727c;
f2451T = cVar;
f2452U = i2;
mediaPlayer = this.f2456D.f896a;
if (mediaPlayer == null) {
}
Log.i(getClass().getSimpleName(), "Media is not playing, start the media and update progressbar");
V0.a aVar3 = this.f2456D;
mediaPlayer2 = aVar3.f896a;
if (mediaPlayer2 != null) {
}
A(cVar, i2);
}
public final void v(int i2) {
Log.d(getClass().getSimpleName(), "scrollListToPosition " + i2);
ScrollingLinearLayoutManager scrollingLinearLayoutManager = this.f2464L;
if (scrollingLinearLayoutManager != null) {
scrollingLinearLayoutManager.p0(i2);
}
}
public final void w() {
Log.d(getClass().getSimpleName(), "showLanguageDialog");
ArrayList arrayList = new ArrayList();
int i2 = 0;
for (int i3 = 0; i3 < 2; i3++) {
arrayList.add(U0.b.f880a[i3]);
}
O0.d dVar = new O0.d(this, this.f2454B.getString(R.string.language_control), this.f2454B.getString(R.string.cancel), arrayList, this.f2455C.b().getInt("language", -1), new T0.a(this, i2), 0);
dVar.requestWindowFeature(1);
dVar.show();
}
public final void x() {
Log.d(getClass().getSimpleName(), "showMaxLoopCountPopup");
Locale a2 = C0244o.a(this);
ArrayList arrayList = new ArrayList();
for (int i2 = 1; i2 <= 15; i2++) {
arrayList.add(C0244o.d(i2, a2));
}
O0.d dVar = new O0.d(this, this.f2454B.getString(R.string.max_repeat_count), this.f2454B.getString(R.string.cancel), arrayList, this.f2455C.d("max_repeat_count", 3), new androidx.activity.result.d(this, arrayList, a2, 10), 2);
dVar.requestWindowFeature(1);
dVar.show();
dVar.a();
}
public final void y(int i2) {
T0.b bVar;
ArrayList arrayList;
Log.d(getClass().getSimpleName(), " Sort List " + i2);
z();
if (i2 == 0) {
arrayList = this.f2471S;
bVar = this.f2459G;
} else {
bVar = this.f2461I;
if (i2 != 1 && i2 == 2) {
arrayList = this.f2471S;
bVar = this.f2460H;
} else {
arrayList = this.f2471S;
}
}
Collections.sort(arrayList, bVar);
h hVar = this.f2466N;
if (hVar != null) {
ArrayList arrayList2 = this.f2471S;
hVar.f712g = arrayList2;
hVar.f713h = arrayList2;
hVar.f2887a.b();
v(0);
}
}
public final void z() {
MediaPlayer mediaPlayer;
Log.d(getClass().getSimpleName(), "stopCurrentMedia");
V0.a aVar = this.f2456D;
if (aVar != null && (mediaPlayer = aVar.f896a) != null) {
mediaPlayer.stop();
a aVar2 = aVar.f900e;
if (aVar2 != null) {
((DashboardActivity) aVar2).o(aVar.f901f, true);
}
}
N0.c cVar = f2451T;
if (cVar != null) {
cVar.f730f = 0;
cVar.f731g = false;
h hVar = this.f2466N;
if (hVar != null) {
hVar.g(f2452U, cVar, null);
}
}
}
}