Add download button to ExpiredActivity.

This commit is contained in:
akwizgran
2018-04-19 17:39:07 +01:00
parent 05621518ab
commit 5883eee42f
3 changed files with 62 additions and 7 deletions

View File

@@ -1,14 +1,20 @@
package org.briarproject.briar.android.splash;
import android.app.Activity;
import android.content.Intent;
import android.net.Uri;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.view.View.OnClickListener;
import org.briarproject.briar.R;
import static android.content.Intent.ACTION_VIEW;
import static android.view.WindowManager.LayoutParams.FLAG_SECURE;
import static org.briarproject.briar.android.TestingConstants.PREVENT_SCREENSHOTS;
public class ExpiredActivity extends Activity {
public class ExpiredActivity extends AppCompatActivity
implements OnClickListener {
@Override
public void onCreate(Bundle state) {
@@ -17,5 +23,13 @@ public class ExpiredActivity extends Activity {
if (PREVENT_SCREENSHOTS) getWindow().addFlags(FLAG_SECURE);
setContentView(R.layout.activity_expired);
findViewById(R.id.download_briar_button).setOnClickListener(this);
}
@Override
public void onClick(View v) {
Uri uri = Uri.parse("https://briarproject.org/download.html");
startActivity(new Intent(ACTION_VIEW, uri));
finish();
}
}

View File

@@ -1,9 +1,47 @@
<?xml version="1.0" encoding="utf-8"?>
<TextView
<ScrollView
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_gravity="center"
android:gravity="center"
android:text="@string/expiry_date_reached"
android:textSize="@dimen/text_size_large"/>
android:orientation="vertical">
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="@dimen/margin_large"
android:orientation="vertical">
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="@dimen/margin_medium"
android:gravity="center"
android:text="@string/expiry_date_reached"
android:textSize="@dimen/text_size_large"/>
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="@dimen/margin_medium"
android:gravity="center"
android:text="@string/download_briar"
android:textSize="@dimen/text_size_large"/>
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="@dimen/margin_medium"
android:gravity="center"
android:text="@string/create_new_account"
android:textSize="@dimen/text_size_large"/>
<Button
android:id="@+id/download_briar_button"
style="@style/BriarButton.Default"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="@dimen/margin_medium"
android:text="@string/download_briar_button"/>
</LinearLayout>
</ScrollView>

View File

@@ -46,6 +46,9 @@
</plurals>
<string name="expiry_update">The beta expiry date has been extended. Your account will now expire in %d days.</string>
<string name="expiry_date_reached">This software has expired.\nThank you for testing!</string>
<string name="download_briar">To continue using Briar, please download version 1.0.</string>
<string name="create_new_account">You will need to create a new account, but you can use the same nickname.</string>
<string name="download_briar_button">Download Briar 1.0</string>
<string name="startup_open_database">Decrypting Database…</string>
<string name="startup_migrate_database">Upgrading Database…</string>