drop "shop" drawer item

This commit is contained in:
Vincent Breitmoser 2020-09-05 14:22:42 +02:00
parent 197afe37cc
commit aa6ff03545
14 changed files with 9 additions and 164 deletions

View file

@ -55,7 +55,6 @@ public class MainActivity extends BaseSecurityTokenActivity implements FabContai
public static final int ID_TRANSFER = 5;
static final int ID_SETTINGS = 6;
static final int ID_HELP = 7;
static final int ID_SHOP = 8;
// both of these are used for instrumentation testing only
public static final String EXTRA_SKIP_FIRST_TIME = "skip_first_time";
@ -78,8 +77,6 @@ public class MainActivity extends BaseSecurityTokenActivity implements FabContai
.withHeader(R.layout.main_drawer_header)
.withToolbar(mToolbar)
.addDrawerItems(
new PrimaryDrawerItem().withName(R.string.nav_shop).withIcon(CommunityMaterial.Icon.cmd_shopping)
.withIdentifier(ID_SHOP).withSelectable(false).withTypeface(Typeface.DEFAULT_BOLD),
new PrimaryDrawerItem().withName(R.string.nav_keys).withIcon(CommunityMaterial.Icon.cmd_key)
.withIdentifier(ID_KEYS).withSelectable(false),
new PrimaryDrawerItem().withName(R.string.nav_encrypt_decrypt).withIcon(FontAwesome.Icon.faw_lock)
@ -125,9 +122,6 @@ public class MainActivity extends BaseSecurityTokenActivity implements FabContai
case ID_HELP:
intent = new Intent(MainActivity.this, HelpActivity.class);
break;
case ID_SHOP:
onShopSelected();
break;
}
if (intent != null) {
MainActivity.this.startActivity(intent);
@ -252,13 +246,6 @@ public class MainActivity extends BaseSecurityTokenActivity implements FabContai
}
}
private void onShopSelected() {
mToolbar.setTitle(R.string.shop_title);
mDrawer.setSelection(ID_SHOP, false);
Fragment frag = new SecurityKeyShopFragment();
setFragment(frag);
}
@Override
protected void onSaveInstanceState(Bundle outState) {
// add the values which need to be saved from the drawer to the bundle

View file

@ -1,77 +0,0 @@
/*
* Copyright (C) 2017 Schürmann & Breitmoser GbR
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package org.sufficientlysecure.keychain.ui;
import android.os.Bundle;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.fragment.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.webkit.WebView;
import android.webkit.WebViewClient;
import android.widget.ProgressBar;
import android.widget.TextView;
import org.sufficientlysecure.keychain.R;
import java.util.HashMap;
import java.util.Map;
public class SecurityKeyShopFragment extends Fragment {
public static final String webShopURL = "https://shop.cotech.de/";
public static final String referer = "https://openkeychain.shop.cotech.de";
public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
View view = inflater.inflate(R.layout.security_key_shop_fragment, container, false);
WebView webView = view.findViewById(R.id.shop_webView);
webView.setWebViewClient(new SecurityKeyShopWebViewClient(
view.findViewById(R.id.shop_progressbar),
view.findViewById(R.id.shop_progressbar_label)
));
webView.getSettings().setJavaScriptEnabled(true);
Map<String, String> headers = new HashMap<>();
headers.put("Referer", referer);
webView.loadUrl(webShopURL, headers);
return view;
}
class SecurityKeyShopWebViewClient extends WebViewClient {
private ProgressBar progressBar;
private TextView progressBarLabel;
SecurityKeyShopWebViewClient(ProgressBar progressBar, TextView progressBarLabel) {
this.progressBar = progressBar;
this.progressBarLabel = progressBarLabel;
progressBar.setVisibility(View.VISIBLE);
progressBarLabel.setVisibility(View.VISIBLE);
}
@Override
public void onPageCommitVisible(WebView view, String url) {
super.onPageCommitVisible(view, url);
progressBar.setVisibility(View.GONE);
progressBarLabel.setVisibility(View.GONE);
}
}
}

View file

@ -1,37 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent">
<WebView
android:id="@+id/shop_webView"
android:layout_width="0dp"
android:layout_height="0dp"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toEndOf="parent" />
<ProgressBar
android:id="@+id/shop_progressbar"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="8dp"
android:layout_marginLeft="8dp"
android:layout_marginTop="8dp"
app:layout_constraintBottom_toBottomOf="@+id/shop_webView"
app:layout_constraintEnd_toEndOf="@+id/shop_webView"
app:layout_constraintStart_toStartOf="@+id/shop_webView"
app:layout_constraintTop_toTopOf="@+id/shop_webView" />
<TextView
android:id="@+id/shop_progressbar_label"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/shop_loading_label"
app:layout_constraintEnd_toEndOf="@+id/shop_progressbar"
app:layout_constraintStart_toStartOf="@+id/shop_progressbar"
app:layout_constraintTop_toBottomOf="@+id/shop_progressbar" />
</androidx.constraintlayout.widget.ConstraintLayout>

View file

@ -698,8 +698,7 @@
<string name="my_keys">Les meves claus</string>
<string name="nav_backup">Còpia de seguretat/Restaura</string>
<string name="nav_transfer">Transferència Wifi segura</string>
<string name="nav_shop">Botiga</string>
<!--hints-->
<!--hints-->
<string name="encrypt_content_edit_text_hint">Escriviu text</string>
<!--certs-->
<string name="cert_default">per defecte</string>

View file

@ -814,8 +814,7 @@
<string name="my_keys">Moje Klíče</string>
<string name="nav_backup">Záloha/Obnova</string>
<string name="nav_transfer">Bezpečný přenos přes WiFi</string>
<string name="nav_shop">Obchod</string>
<!--hints-->
<!--hints-->
<string name="encrypt_content_edit_text_hint">Napsat text</string>
<!--certs-->
<string name="cert_default">výchozí</string>
@ -1878,6 +1877,4 @@
<string name="subkey_action_expiry_date">Doba platnosti se změni do %s</string>
<string name="share_key_clipboard">Sdílet klíč skrze schránku</string>
<string name="share_key">Sdílet klíč</string>
<string name="shop_loading_label">Otevírám obchod...</string>
<string name="shop_title">COTECH Security Keys</string>
</resources>

View file

@ -778,8 +778,7 @@
<string name="my_keys">Meine Schlüssel</string>
<string name="nav_backup">Backup/Wiederherstellung</string>
<string name="nav_transfer">Sichere WiFi Übertragung</string>
<string name="nav_shop">Shop</string>
<!--hints-->
<!--hints-->
<string name="encrypt_content_edit_text_hint">Text eingeben</string>
<!--certs-->
<string name="cert_default">normal</string>
@ -1811,6 +1810,4 @@ Ein sicherer Schlüssel sollte eine Stärke von 2048 Bits besitzen.</string>
<string name="subkey_action_expiry_date">Ablauf wird geändert zu \"%s\"</string>
<string name="share_key_clipboard">Schlüssel per Zwischenablage teilen</string>
<string name="share_key">Schlüssel teilen</string>
<string name="shop_loading_label">Shop wird geladen...</string>
<string name="shop_title">COTECH Sicherheitsschlüssel</string>
</resources>

View file

@ -778,8 +778,7 @@
<string name="my_keys">Mes clés</string>
<string name="nav_backup">Sauvegarder/Restaurer</string>
<string name="nav_transfer">Transfert Wi-Fi sécurisé</string>
<string name="nav_shop">Boutique</string>
<!--hints-->
<!--hints-->
<string name="encrypt_content_edit_text_hint">Saisir le texte</string>
<!--certs-->
<string name="cert_default">valeur par défaut</string>
@ -1810,6 +1809,4 @@
<string name="subkey_action_expiry_date">La date dexpiration sera changé à %s</string>
<string name="share_key_clipboard">Partager la clé avec le presse-papiers</string>
<string name="share_key">Partager la clé</string>
<string name="shop_loading_label">Chargement de la boutique…</string>
<string name="shop_title">Clés de sécurité COTECH</string>
</resources>

View file

@ -747,6 +747,4 @@
<string name="subkey_action_expiry_date">A lejárat %s értékre változik</string>
<string name="share_key_clipboard">Kulcs megosztása vágólappal</string>
<string name="share_key">Kulcs megosztása</string>
<string name="shop_loading_label">Shop betöltése...</string>
<string name="shop_title">COTECH biztonsági kulcsok</string>
</resources>

View file

@ -764,8 +764,7 @@
<string name="my_keys">自分の鍵</string>
<string name="nav_backup">バックアップ/リストア</string>
<string name="nav_transfer">安全な Wifi 転送</string>
<string name="nav_shop">ショップ</string>
<!--hints-->
<!--hints-->
<string name="encrypt_content_edit_text_hint">テキストを入力</string>
<!--certs-->
<string name="cert_default">デフォルト</string>
@ -1780,6 +1779,4 @@
<string name="subkey_action_expiry_date">有効期限は%sに変更されます</string>
<string name="share_key_clipboard">クリップボードでキーを共有する</string>
<string name="share_key">鍵の共有</string>
<string name="shop_loading_label">ショップを読み込んでいます…</string>
<string name="shop_title">COTECH セキュリティ鍵</string>
</resources>

View file

@ -778,8 +778,7 @@
<string name="my_keys">Mijn sleutels</string>
<string name="nav_backup">Back-up/herstellen</string>
<string name="nav_transfer">Beveiligde wifi-overdracht</string>
<string name="nav_shop">Winkel</string>
<!--hints-->
<!--hints-->
<string name="encrypt_content_edit_text_hint">Voer tekst in</string>
<!--certs-->
<string name="cert_default">standaard</string>
@ -1810,6 +1809,4 @@
<string name="subkey_action_expiry_date">Verloopdatum zal wijzigen naar %s</string>
<string name="share_key_clipboard">Sleutel delen via klembord</string>
<string name="share_key">Sleutel delen</string>
<string name="shop_loading_label">Winkel aan het laden…</string>
<string name="shop_title">COTECH-beveiligingssleutels</string>
</resources>

View file

@ -815,8 +815,7 @@
<string name="my_keys">Мои ключи</string>
<string name="nav_backup">Резервирование/Восстановление</string>
<string name="nav_transfer">Безопасная передача по Wi-Fi</string>
<string name="nav_shop">Магазин</string>
<!--hints-->
<!--hints-->
<string name="encrypt_content_edit_text_hint">Напишите текст</string>
<!--certs-->
<string name="cert_default">по умолчанию</string>
@ -1879,6 +1878,4 @@
<string name="subkey_action_expiry_date">Срок годности будет изменён на %s</string>
<string name="share_key_clipboard">Отправить ключ в буфер обмена</string>
<string name="share_key">Отправить ключ</string>
<string name="shop_loading_label">Загрузка магазина...</string>
<string name="shop_title">Ключи безопасности COTECH</string>
</resources>

View file

@ -774,8 +774,7 @@
<string name="my_keys">Mina nycklar</string>
<string name="nav_backup">Säkerhetskopiera/återställa</string>
<string name="nav_transfer">Säker Wi-Fi-överföring</string>
<string name="nav_shop">Butik</string>
<!--hints-->
<!--hints-->
<string name="encrypt_content_edit_text_hint">Skriv text</string>
<!--certs-->
<string name="cert_default">förval</string>

View file

@ -760,8 +760,7 @@
<string name="my_keys">我的密钥</string>
<string name="nav_backup">备份/恢复</string>
<string name="nav_transfer">安全 Wifi 传输</string>
<string name="nav_shop">商店</string>
<!--hints-->
<!--hints-->
<string name="encrypt_content_edit_text_hint">此处输入要加密的内容</string>
<!--certs-->
<string name="cert_default">默认</string>
@ -1776,6 +1775,4 @@
<string name="subkey_action_expiry_date">过期时间将更改为%s</string>
<string name="share_key_clipboard">通过剪贴板共享</string>
<string name="share_key">共享密钥</string>
<string name="shop_loading_label">加载商店</string>
<string name="shop_title">COTECH 安全密钥</string>
</resources>

View file

@ -817,7 +817,6 @@
<string name="my_keys">"My Keys"</string>
<string name="nav_backup">"Backup/Restore"</string>
<string name="nav_transfer">"Secure Wifi Transfer"</string>
<string name="nav_shop">Shop</string>
<!-- hints -->
<string name="encrypt_content_edit_text_hint">"Type text"</string>
@ -1912,6 +1911,4 @@
<string name="share_key_clipboard">Share key via clipboard</string>
<string name="share_key">Share key</string>
<string name="shop_loading_label">Loading shop…</string>
<string name="shop_title">COTECH Security Keys</string>
</resources>