From e032ce59b6bd5dbad2091abe23ca284464ed229f Mon Sep 17 00:00:00 2001 From: Benojir Sultana <124562791+Benojir@users.noreply.github.com> Date: Wed, 11 Sep 2024 13:06:54 +0530 Subject: [PATCH] modified --- app/build.gradle | 23 ++++--- app/src/main/AndroidManifest.xml | 5 +- .../tv/activities/GenreViewActivity.java | 18 +++-- .../fogplix/tv/activities/PlayerActivity.java | 24 +++---- .../fogplix/tv/adapters/GenreCardAdapter.java | 8 ++- .../com/fogplix/tv/helpers/CustomMethods.java | 24 +------ .../main/res/layout/exoplayer_controller.xml | 52 ++++++++++++-- app/src/main/res/layout/header_layout.xml | 67 ------------------- app/src/main/res/values/strings.xml | 8 +-- app/src/main/res/xml/root_preferences.xml | 6 -- build.gradle | 2 + 11 files changed, 97 insertions(+), 140 deletions(-) delete mode 100644 app/src/main/res/layout/header_layout.xml diff --git a/app/build.gradle b/app/build.gradle index bcdb8b6..77e4b71 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -1,6 +1,7 @@ plugins { id 'com.android.application' id 'com.google.gms.google-services' + id 'com.google.firebase.crashlytics' } android { @@ -10,9 +11,10 @@ android { defaultConfig { applicationId "com.fogplix.tv" minSdk 27 + //noinspection OldTargetApi targetSdk 34 - versionCode 6 - versionName "1.6" + versionCode 7 + versionName "1.7" testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" } @@ -38,20 +40,23 @@ dependencies { implementation 'com.google.android.material:material:1.12.0' implementation 'androidx.constraintlayout:constraintlayout:2.1.4' implementation 'androidx.preference:preference:1.2.1' + implementation 'androidx.core:core-splashscreen:1.0.1' testImplementation 'junit:junit:4.13.2' androidTestImplementation 'androidx.test.ext:junit:1.2.1' androidTestImplementation 'androidx.test.espresso:espresso-core:3.6.1' - implementation 'com.google.firebase:firebase-messaging:24.0.0' + implementation 'com.google.firebase:firebase-crashlytics:19.0.3' + implementation 'com.google.firebase:firebase-analytics:22.1.0' + implementation 'com.google.firebase:firebase-messaging:24.0.1' + implementation 'com.android.volley:volley:1.2.1' implementation "com.github.bumptech.glide:glide:4.16.0" implementation 'com.github.bosphere.android-fadingedgelayout:fadingedgelayout:1.0.0' + implementation 'org.jsoup:jsoup:1.16.1' - implementation 'androidx.media3:media3-exoplayer:1.3.1' - implementation 'androidx.media3:media3-exoplayer-dash:1.3.1' - implementation 'androidx.media3:media3-exoplayer-hls:1.3.1' - implementation 'androidx.media3:media3-ui:1.3.1' + implementation 'androidx.media3:media3-exoplayer:1.4.1' + implementation 'androidx.media3:media3-exoplayer-dash:1.4.1' + implementation 'androidx.media3:media3-exoplayer-hls:1.4.1' + implementation 'androidx.media3:media3-ui:1.4.1' - implementation 'androidx.core:core-splashscreen:1.0.1' - implementation 'org.jsoup:jsoup:1.16.1' } \ No newline at end of file diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index bd1366a..22393e2 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -92,10 +92,11 @@ android:configChanges="orientation|uiMode|screenSize|keyboardHidden" android:exported="false" android:hardwareAccelerated="true" - android:screenOrientation="sensorLandscape"> + android:screenOrientation="sensorLandscape" + tools:ignore="DiscouragedApi" /> onBackPressed()); + ownToolbarBinding.navbarLeftBtn.setOnFocusChangeListener((v, hasFocus) -> { + if (hasFocus) { + ownToolbarBinding.navbarLeftBtn.setBackgroundResource(R.drawable.button_focused); + } else { + ownToolbarBinding.navbarLeftBtn.setBackgroundResource(R.drawable.button_default); + } + }); + int screenSize = getResources().getConfiguration().screenLayout & Configuration.SCREENLAYOUT_SIZE_MASK; rvAdapter = new ItemsListAdapter(GenreViewActivity.this, allAnime); @@ -82,10 +94,6 @@ protected void onCreate(Bundle savedInstanceState) { page = page + 1; loadAnime(page); }); - - //////////////////////////////////////////////////////////////////////////////////////////// - - ownToolbarBinding.navbarLeftBtn.setOnClickListener(view -> onBackPressed()); } // ---------------------------------------------------------------------------------------------- @@ -135,7 +143,7 @@ public void onScrapeComplete(JSONArray resultAnime) { } } catch (JSONException e){ - e.printStackTrace(); + Log.e(TAG, "onScrapeComplete: ", e); CustomMethods.errorAlert(GenreViewActivity.this, "Error (Json)", e.getMessage(), "OK", false); } } diff --git a/app/src/main/java/com/fogplix/tv/activities/PlayerActivity.java b/app/src/main/java/com/fogplix/tv/activities/PlayerActivity.java index bfacde0..36dbd44 100644 --- a/app/src/main/java/com/fogplix/tv/activities/PlayerActivity.java +++ b/app/src/main/java/com/fogplix/tv/activities/PlayerActivity.java @@ -161,13 +161,6 @@ protected void onCreate(Bundle savedInstanceState) { //------------------------------------------------------------------------------------------ - if (preferences.getBoolean("85s_skipping_button", false)) { - skipIntroOutroBtn.setVisibility(View.VISIBLE); - skipIntroOutroBtn.setText("Skip 85s"); - } - - //------------------------------------------------------------------------------------------ - episodeLoadingTV.setText("Loading episode " + CustomMethods.extractEpisodeNumberFromId(episodeId)); GenerateDirectLink generateDirectLink = new GenerateDirectLink(this); @@ -227,9 +220,15 @@ public void onFailed(String error) { //+++++++++++++++++++++++ Below section is handing button actions ++++++++++++++++++++++++++ skipIntroOutroBtn.setOnClickListener(v -> { - if (preferences.getBoolean("85s_skipping_button", false)) { - long currentVideoPosition = exoPlayer.getCurrentPosition(); - exoPlayer.seekTo(currentVideoPosition + 85000); + long currentVideoPosition = exoPlayer.getCurrentPosition(); + exoPlayer.seekTo(currentVideoPosition + 85000); + }); + + skipIntroOutroBtn.setOnFocusChangeListener((v, hasFocus) -> { + if (hasFocus) { + skipIntroOutroBtn.setTextColor(getColor(R.color.green)); + } else { + skipIntroOutroBtn.setTextColor(getColor(R.color.white)); } }); @@ -479,10 +478,7 @@ public void onPlaybackStateChanged(int playbackState) { } if (playbackState == Player.STATE_READY) { - if (preferences.getBoolean("85s_skipping_button", false)) { - skipIntroOutroBtn.setVisibility(View.VISIBLE); - } - + skipIntroOutroBtn.setVisibility(View.VISIBLE); exoPlayerView.setVisibility(View.VISIBLE); bufferingProgressBar.setVisibility(View.GONE); videoNameTV.setText(animeTitle.trim()); diff --git a/app/src/main/java/com/fogplix/tv/adapters/GenreCardAdapter.java b/app/src/main/java/com/fogplix/tv/adapters/GenreCardAdapter.java index 1c86f7b..ca0d75e 100644 --- a/app/src/main/java/com/fogplix/tv/adapters/GenreCardAdapter.java +++ b/app/src/main/java/com/fogplix/tv/adapters/GenreCardAdapter.java @@ -65,11 +65,13 @@ public void onBindViewHolder(@NonNull GenreCardAdapter.MyCustomViewHolder holder return false; }); - holder.itemView.setOnFocusChangeListener((view, b) -> { - if (b) { - holder.cardView.setCardBackgroundColor(context.getColor(R.color.orange)); + holder.itemView.setOnFocusChangeListener((view, hasFocus) -> { + if (hasFocus) { + holder.cardView.setCardBackgroundColor(context.getColor(R.color.white)); + holder.genreTV.setTextColor(context.getColor(R.color.black)); } else { holder.cardView.setCardBackgroundColor(color); + holder.genreTV.setTextColor(context.getColor(R.color.white)); } }); } diff --git a/app/src/main/java/com/fogplix/tv/helpers/CustomMethods.java b/app/src/main/java/com/fogplix/tv/helpers/CustomMethods.java index 051ae11..e2b6ead 100644 --- a/app/src/main/java/com/fogplix/tv/helpers/CustomMethods.java +++ b/app/src/main/java/com/fogplix/tv/helpers/CustomMethods.java @@ -137,24 +137,6 @@ public static void errorAlert(Activity activity, String errorTitle, String error } } - public static void warningAlert(Activity activity, String warningTitle, String warningBody, String actionButton, boolean shouldGoBack) { - if (!activity.isFinishing()) { - AlertDialog.Builder builder = new AlertDialog.Builder(activity); - builder.setTitle(warningTitle); - builder.setMessage(warningBody); - builder.setIcon(R.drawable.warning); - builder.setPositiveButton(actionButton, (dialogInterface, i) -> { - if (shouldGoBack) { - activity.finish(); - } else { - dialogInterface.dismiss(); - } - }); - AlertDialog dialog = builder.create(); - dialog.show(); - } - } - //-------------------------------------------------------------------------------------------------- public static void checkNewNotice(Context context, TextView textView) { @@ -164,8 +146,7 @@ public static void checkNewNotice(Context context, TextView textView) { new Thread(() -> { try { - String newNoticeJSON = - Jsoup.connect(context.getString(R.string.new_notice_json_link)) + String newNoticeJSON = Jsoup.connect(context.getString(R.string.new_notice_json_link)) .timeout(30000) .ignoreContentType(true) .execute().body(); @@ -212,8 +193,7 @@ public static void checkForUpdateOnStartApp(Activity activity) { new Thread(() -> { try { - String versionInfoJSON = - Jsoup.connect(activity.getString(R.string.version_page_link)) + String versionInfoJSON = Jsoup.connect(activity.getString(R.string.version_page_link)) .timeout(30000) .ignoreContentType(true) .execute().body(); diff --git a/app/src/main/res/layout/exoplayer_controller.xml b/app/src/main/res/layout/exoplayer_controller.xml index c7ed56e..2c96fa8 100644 --- a/app/src/main/res/layout/exoplayer_controller.xml +++ b/app/src/main/res/layout/exoplayer_controller.xml @@ -36,8 +36,11 @@ + tools:ignore="ContentDescription,DuplicateSpeakableTextCheck" /> + android:nextFocusRight="@id/backward_10" + android:nextFocusDown="@id/exo_progress" + android:nextFocusForward="@id/backward_10" + android:src="@drawable/skip_previous_24" + tools:ignore="DuplicateSpeakableTextCheck" /> @@ -125,12 +144,18 @@ android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_above="@+id/exo_progress" - android:visibility="gone" + android:visibility="visible" android:layout_alignParentEnd="true" android:textColor="@color/white" android:layout_marginHorizontal="15dp" style="@style/Widget.MaterialComponents.Button.OutlinedButton" - android:text="Skip" /> + android:nextFocusForward="@id/exo_progress" + android:nextFocusRight="@id/exo_progress" + android:nextFocusDown="@id/exo_progress" + android:nextFocusLeft="@id/next_episode" + android:nextFocusUp="@id/exo_play_pause" + android:textAllCaps="false" + android:text="SKIP 85s" /> + style="@style/ExoStyledControls.Button.Bottom.CC" + android:nextFocusForward="@id/exo_settings" + android:nextFocusRight="@id/exo_settings" + android:nextFocusDown="@id/backButton"/> + style="@style/ExoStyledControls.Button.Bottom.Settings" + android:nextFocusForward="@id/backButton" + android:nextFocusRight="@id/backButton" + android:nextFocusDown="@id/backButton"/> diff --git a/app/src/main/res/layout/header_layout.xml b/app/src/main/res/layout/header_layout.xml deleted file mode 100644 index 7f94220..0000000 --- a/app/src/main/res/layout/header_layout.xml +++ /dev/null @@ -1,67 +0,0 @@ - - - - - - - - - - - - - - - - - - diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 4feed0f..776ce7c 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -1,6 +1,5 @@ - - Fogplix Anime - Fogplix Anime + + Fogplix TV Sub Dub @@ -13,14 +12,11 @@ https://proxy.fogplix-anime.com/browse.php?link= Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/124.0.0.0 Safari/537.36 - Watch free anime (Dubbed and Subbed) with Fogplix Anime app. Download now from - c0feb5c5-3fe1-490a-bcf2-0af7ed45a18b Favorites Search https://benojir.github.io/Fogplix-Landing-Page/updates/version-tv.json https://benojir.github.io/Fogplix-Landing-Page/updates/fogplix-alert-tv.json - https://benojir.github.io/Fogplix-Landing-Page/updates/playable-servers-status.json https://ajax.gogocdn.net/ajax/page-recent-release.html https://ajax.gogocdn.net/ajax/load-list-episode diff --git a/app/src/main/res/xml/root_preferences.xml b/app/src/main/res/xml/root_preferences.xml index dd13149..4d14aef 100644 --- a/app/src/main/res/xml/root_preferences.xml +++ b/app/src/main/res/xml/root_preferences.xml @@ -6,12 +6,6 @@ app:summaryOn="@string/proxy_setting_summary_on" app:title="@string/proxy_setting_title" /> - -