mirror of
https://github.com/kiwix/kiwix-android.git
synced 2025-09-15 18:36:01 -04:00
fixed issue with backtotop and stoptts buttons
This commit is contained in:
parent
63cc3e294e
commit
a7c87b7e00
Binary file not shown.
Before Width: | Height: | Size: 3.8 KiB |
BIN
res/drawable/kiwix_icon_with_title.png
Normal file
BIN
res/drawable/kiwix_icon_with_title.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 8.5 KiB |
@ -4,7 +4,7 @@
|
||||
<item android:drawable="@android:color/white"/>
|
||||
<item>
|
||||
<bitmap
|
||||
android:src="@drawable/kiwix_icon__with_title"
|
||||
android:src="@drawable/kiwix_icon_with_title"
|
||||
android:gravity="center"
|
||||
/>
|
||||
</item>
|
||||
|
@ -11,7 +11,7 @@
|
||||
<ScrollView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="@color/white">
|
||||
android:background="@color/blue_grey">
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
|
@ -75,7 +75,7 @@
|
||||
android:textColor="@android:color/black"
|
||||
android:textStyle="bold"
|
||||
android:text="stop"
|
||||
android:visibility="invisible"/>
|
||||
android:visibility="gone"/>
|
||||
|
||||
|
||||
</RelativeLayout>
|
||||
|
@ -17,4 +17,5 @@
|
||||
<color name="greyed_out_selected">#BDBDBD</color>
|
||||
<color name="black_regular_mat_design">#212121</color>
|
||||
<color name="grey">#808080</color>
|
||||
<color name="blue_grey">#ECEFF1</color>
|
||||
</resources>
|
@ -62,7 +62,7 @@
|
||||
<string name="clear_recent_history_dialog">Are you sure you want to delete your search history?</string>
|
||||
<string name="clear_recent_and_tabs_history_dialog">Are you sure you want to delete your search history and reset all active tabs?</string>
|
||||
<string name="delete_recent_search_item">Delete this item?</string>
|
||||
<string name="pref_clear_all_history_title">Clear History</string>
|
||||
<string name="pref_clear_all_history_title">Clear history</string>
|
||||
<string name="pref_clear_all_history_summary">Clear recent searches and tabs history</string>
|
||||
<string name="all_history_cleared_toast">All History Cleared</string>
|
||||
<string name="clear_all_history_dialog_title">Clear All History</string>
|
||||
|
@ -322,8 +322,8 @@ public class KiwixMobileActivity extends AppCompatActivity {
|
||||
@Override
|
||||
public void onClick(View view) {
|
||||
readAloud();
|
||||
stopTTSButton.setVisibility(View.INVISIBLE);
|
||||
mIsBacktotopEnabled = true;
|
||||
stopTTSButton.setVisibility(View.GONE);
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
@ -608,7 +608,7 @@ public class KiwixMobileActivity extends AppCompatActivity {
|
||||
public void run() {
|
||||
menu.findItem(R.id.menu_read_aloud)
|
||||
.setTitle(getResources().getString(R.string.menu_read_aloud));
|
||||
stopTTSButton.setVisibility(View.INVISIBLE);
|
||||
stopTTSButton.setVisibility(View.GONE);
|
||||
}
|
||||
});
|
||||
}
|
||||
@ -829,12 +829,18 @@ public class KiwixMobileActivity extends AppCompatActivity {
|
||||
break;
|
||||
|
||||
case R.id.menu_read_aloud:
|
||||
readAloud();
|
||||
stopTTSButton.setVisibility(View.VISIBLE);
|
||||
if(mIsBacktotopEnabled) {
|
||||
mBackToTopButton.setVisibility(View.INVISIBLE);
|
||||
mIsBacktotopEnabled = false;
|
||||
if(stopTTSButton.getVisibility() == View.GONE) {
|
||||
if(mIsBacktotopEnabled) {
|
||||
mBackToTopButton.setVisibility(View.INVISIBLE);
|
||||
}
|
||||
} else if (stopTTSButton.getVisibility() == View.VISIBLE){
|
||||
if(mIsBacktotopEnabled) {
|
||||
mBackToTopButton.setVisibility(View.VISIBLE);
|
||||
}
|
||||
}
|
||||
readAloud();
|
||||
|
||||
|
||||
break;
|
||||
|
||||
case R.id.menu_fullscreen:
|
||||
@ -1270,7 +1276,7 @@ public class KiwixMobileActivity extends AppCompatActivity {
|
||||
public void onPageChanged(int page, int maxPages) {
|
||||
if (mIsBacktotopEnabled) {
|
||||
if (getCurrentWebView().getScrollY() > 200) {
|
||||
if (mBackToTopButton.getVisibility() == View.INVISIBLE) {
|
||||
if (mBackToTopButton.getVisibility() == View.INVISIBLE && stopTTSButton.getVisibility() == View.GONE ) {
|
||||
mBackToTopButton.setText(R.string.button_backtotop);
|
||||
mBackToTopButton.setVisibility(View.VISIBLE);
|
||||
|
||||
@ -1279,7 +1285,7 @@ public class KiwixMobileActivity extends AppCompatActivity {
|
||||
mBackToTopButton.setVisibility(View.INVISIBLE);
|
||||
Animation fadeAnimation =
|
||||
AnimationUtils.loadAnimation(KiwixMobileActivity.this, android.R.anim.fade_out);
|
||||
fadeAnimation.setStartOffset(1500);
|
||||
fadeAnimation.setStartOffset(1200);
|
||||
mBackToTopButton.startAnimation(fadeAnimation);
|
||||
}
|
||||
} else {
|
||||
|
Loading…
x
Reference in New Issue
Block a user