Reinstate the About dialog.

Currently available as the first entry in Preferences. Used to be
available in the main action bar menu.

Fixes #906.
This commit is contained in:
Peter Serwylo 2017-03-29 16:22:05 +11:00
parent 5ef5288e3a
commit 655c4bfdd3
4 changed files with 63 additions and 0 deletions

View File

@ -530,6 +530,8 @@
android:value=".views.main.MainActivity" />
</activity>
<activity android:name=".AboutActivity" android:theme="@style/Theme.AppCompat.Light.Dialog" />
</application>
</manifest>

View File

@ -0,0 +1,34 @@
package org.fdroid.fdroid;
import android.os.Build;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.widget.TextView;
public class AboutActivity extends AppCompatActivity {
@Override
protected void onCreate(@Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.about);
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB) {
setFinishOnTouchOutside(false);
}
String versionName = Utils.getVersionName(this);
if (versionName != null) {
((TextView) findViewById(R.id.version)).setText(versionName);
}
findViewById(R.id.ok_button).setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
finish();
}
});
}
}

View File

@ -50,6 +50,25 @@
android:text="@string/license_gplv3_later"
style="@style/BodyText" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:gravity="center"
android:layout_marginTop="12dp"
android:paddingBottom="16dp"
android:clipToPadding="false">
<Button
android:layout_width="wrap_content"
android:minWidth="100dp"
android:layout_height="wrap_content"
style="@style/DetailsPrimaryButtonStyle"
android:id="@+id/ok_button"
android:text="@string/ok" />
</LinearLayout>
</LinearLayout>
</ScrollView>

View File

@ -1,5 +1,13 @@
<?xml version="1.0" encoding="utf-8"?>
<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android">
<PreferenceCategory android:title="@string/menu_about">
<PreferenceScreen android:title="@string/about_title">
<intent
android:action="android.intent.action.MAIN"
android:targetPackage="org.fdroid.fdroid"
android:targetClass="org.fdroid.fdroid.AboutActivity" />
</PreferenceScreen>
</PreferenceCategory>
<PreferenceCategory android:title="@string/preference_category__my_apps">
<PreferenceScreen android:title="@string/preference_manage_installed_apps">
<intent