kopia lustrzana https://github.com/TeamNewPipe/NewPipe
Move "Done" button and make it theme conpliant in ReCaptcha
rodzic
fe138f6d61
commit
0cc890a1d1
|
@ -17,6 +17,8 @@ import android.webkit.WebSettings;
|
|||
import android.webkit.WebView;
|
||||
import android.webkit.WebViewClient;
|
||||
|
||||
import org.schabi.newpipe.util.ThemeHelper;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
|
@ -49,6 +51,7 @@ public class ReCaptchaActivity extends AppCompatActivity {
|
|||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
ThemeHelper.setTheme(this);
|
||||
super.onCreate(savedInstanceState);
|
||||
setContentView(R.layout.activity_recaptcha);
|
||||
Toolbar toolbar = findViewById(R.id.toolbar);
|
||||
|
@ -92,17 +95,16 @@ public class ReCaptchaActivity extends AppCompatActivity {
|
|||
|
||||
@Override
|
||||
public boolean onCreateOptionsMenu(Menu menu) {
|
||||
boolean ret = super.onCreateOptionsMenu(menu);
|
||||
getMenuInflater().inflate(R.menu.menu_recaptcha, menu);
|
||||
|
||||
ActionBar actionBar = getSupportActionBar();
|
||||
if (actionBar != null) {
|
||||
actionBar.setDisplayHomeAsUpEnabled(true);
|
||||
actionBar.setHomeAsUpIndicator(getResources().getDrawable(R.drawable.ic_done_white_24dp));
|
||||
actionBar.setDisplayHomeAsUpEnabled(false);
|
||||
actionBar.setTitle(R.string.title_activity_recaptcha);
|
||||
actionBar.setSubtitle(R.string.subtitle_activity_recaptcha);
|
||||
}
|
||||
|
||||
return ret;
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -114,7 +116,7 @@ public class ReCaptchaActivity extends AppCompatActivity {
|
|||
public boolean onOptionsItemSelected(MenuItem item) {
|
||||
int id = item.getItemId();
|
||||
switch (id) {
|
||||
case android.R.id.home:
|
||||
case R.id.menu_item_done:
|
||||
saveCookiesAndFinish();
|
||||
return true;
|
||||
default:
|
||||
|
|
|
@ -0,0 +1,9 @@
|
|||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="24dp"
|
||||
android:height="24dp"
|
||||
android:viewportWidth="24.0"
|
||||
android:viewportHeight="24.0">
|
||||
<path
|
||||
android:fillColor="#FF000000"
|
||||
android:pathData="M9,16.2L4.8,12l-1.4,1.4L9,19 21,7l-1.4,-1.4L9,16.2z"/>
|
||||
</vector>
|
|
@ -14,8 +14,7 @@
|
|||
android:minHeight="?attr/actionBarSize"
|
||||
android:theme="@style/ThemeOverlay.AppCompat.ActionBar"
|
||||
app:popupTheme="@style/ThemeOverlay.AppCompat.ActionBar"
|
||||
app:titleTextAppearance="@style/Toolbar.Title"
|
||||
app:contentInsetStartWithNavigation="0dp" />
|
||||
app:titleTextAppearance="@style/Toolbar.Title"/>
|
||||
|
||||
<WebView
|
||||
android:id="@+id/reCaptchaWebView"
|
||||
|
|
|
@ -0,0 +1,10 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<menu xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto">
|
||||
|
||||
<item
|
||||
android:id="@+id/menu_item_done"
|
||||
android:title="@string/recaptcha_done_button"
|
||||
android:icon="?attr/ic_done"
|
||||
app:showAsAction="always"/>
|
||||
</menu>
|
|
@ -45,6 +45,7 @@
|
|||
<attr name="ic_grid" format="reference"/>
|
||||
<attr name="ic_delete" format="reference"/>
|
||||
<attr name="ic_settings_update" format="reference"/>
|
||||
<attr name="ic_done" format="reference"/>
|
||||
|
||||
<attr name="progress_horizontal_drawable" format="reference"/>
|
||||
<!-- Can't refer to colors directly in drawable's xml-->
|
||||
|
|
|
@ -331,6 +331,7 @@
|
|||
<string name="title_activity_recaptcha">reCAPTCHA challenge</string>
|
||||
<string name="subtitle_activity_recaptcha">Press \"Done\" when solved</string>
|
||||
<string name="recaptcha_request_toast">reCAPTCHA challenge requested</string>
|
||||
<string name="recaptcha_done_button">Done</string>
|
||||
<!-- Downloads -->
|
||||
<string name="settings_category_downloads_title">Download</string>
|
||||
<string name="settings_file_charset_title">Allowed characters in filenames</string>
|
||||
|
|
|
@ -60,6 +60,7 @@
|
|||
<item name="ic_grid">@drawable/ic_grid_black_24dp</item>
|
||||
<item name="ic_delete">@drawable/ic_delete_black_24dp</item>
|
||||
<item name="ic_settings_update">@drawable/ic_settings_update_black</item>
|
||||
<item name="ic_done">@drawable/ic_done_black_24dp</item>
|
||||
|
||||
<item name="separator_color">@color/light_separator_color</item>
|
||||
<item name="contrast_background_color">@color/light_contrast_background_color</item>
|
||||
|
@ -129,6 +130,7 @@
|
|||
<item name="ic_delete">@drawable/ic_delete_white_24dp</item>
|
||||
<item name="pause">@drawable/ic_pause_white_24dp</item>
|
||||
<item name="ic_settings_update">@drawable/ic_settings_update_white</item>
|
||||
<item name="ic_done">@drawable/ic_done_white_24dp</item>
|
||||
|
||||
<item name="separator_color">@color/dark_separator_color</item>
|
||||
<item name="contrast_background_color">@color/dark_contrast_background_color</item>
|
||||
|
|
Ładowanie…
Reference in New Issue