diff options
author | Stefan Niedermann <stefan.niedermann@googlemail.com> | 2016-01-24 12:31:15 +0300 |
---|---|---|
committer | Stefan Niedermann <stefan.niedermann@googlemail.com> | 2016-01-24 12:31:15 +0300 |
commit | 353949760bb22375eae7613f30e0fb6bcd982130 (patch) | |
tree | 63bbdf0192a8159f8a9b129884a34e5207ae9275 /app | |
parent | 5b989b9408ba14287569a5769208598ddb9d7b3e (diff) |
WiP #40 Mention license, source code and call to contribution in the »About« section - Switched to Tabbed Layout in About Activity
Diffstat (limited to 'app')
8 files changed, 234 insertions, 54 deletions
diff --git a/app/src/main/java/it/niedermann/owncloud/notes/android/activity/AboutActivity.java b/app/src/main/java/it/niedermann/owncloud/notes/android/activity/AboutActivity.java index dc2cc76d..53a887a6 100644 --- a/app/src/main/java/it/niedermann/owncloud/notes/android/activity/AboutActivity.java +++ b/app/src/main/java/it/niedermann/owncloud/notes/android/activity/AboutActivity.java @@ -1,15 +1,31 @@ package it.niedermann.owncloud.notes.android.activity; import android.os.Bundle; +import android.support.v4.app.FragmentTabHost; import android.support.v7.app.AppCompatActivity; import it.niedermann.owncloud.notes.R; +import it.niedermann.owncloud.notes.android.fragment.about.AboutFragmentContributingTab; +import it.niedermann.owncloud.notes.android.fragment.about.AboutFragmentCredentialsTab; +import it.niedermann.owncloud.notes.android.fragment.about.AboutFragmentLicenseTab; public class AboutActivity extends AppCompatActivity { + private FragmentTabHost mTabHost; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); + setContentView(R.layout.activity_about); + mTabHost = (FragmentTabHost) findViewById(android.R.id.tabhost); + mTabHost.setup(this, getSupportFragmentManager(), R.id.realtabcontent); + + mTabHost.addTab(mTabHost.newTabSpec("Credentials").setIndicator("Credentials"), + AboutFragmentCredentialsTab.class, null); + mTabHost.addTab(mTabHost.newTabSpec("Contribution").setIndicator("Contribution"), + AboutFragmentContributingTab.class, null); + mTabHost.addTab(mTabHost.newTabSpec("License").setIndicator("License"), + AboutFragmentLicenseTab.class, null); } + } diff --git a/app/src/main/java/it/niedermann/owncloud/notes/android/fragment/about/AboutFragmentContributingTab.java b/app/src/main/java/it/niedermann/owncloud/notes/android/fragment/about/AboutFragmentContributingTab.java new file mode 100644 index 00000000..96c6d64f --- /dev/null +++ b/app/src/main/java/it/niedermann/owncloud/notes/android/fragment/about/AboutFragmentContributingTab.java @@ -0,0 +1,16 @@ +package it.niedermann.owncloud.notes.android.fragment.about; + +import android.os.Bundle; +import android.support.v4.app.Fragment; +import android.view.LayoutInflater; +import android.view.View; +import android.view.ViewGroup; + +import it.niedermann.owncloud.notes.R; + +public class AboutFragmentContributingTab extends Fragment { + @Override + public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { + return inflater.inflate(R.layout.fragment_about_contribution_tab, container, false); + } +}
\ No newline at end of file diff --git a/app/src/main/java/it/niedermann/owncloud/notes/android/fragment/about/AboutFragmentCredentialsTab.java b/app/src/main/java/it/niedermann/owncloud/notes/android/fragment/about/AboutFragmentCredentialsTab.java new file mode 100644 index 00000000..59691335 --- /dev/null +++ b/app/src/main/java/it/niedermann/owncloud/notes/android/fragment/about/AboutFragmentCredentialsTab.java @@ -0,0 +1,16 @@ +package it.niedermann.owncloud.notes.android.fragment.about; + +import android.os.Bundle; +import android.support.v4.app.Fragment; +import android.view.LayoutInflater; +import android.view.View; +import android.view.ViewGroup; + +import it.niedermann.owncloud.notes.R; + +public class AboutFragmentCredentialsTab extends Fragment { + @Override + public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { + return inflater.inflate(R.layout.fragment_about_credentials_tab, container, false); + } +}
\ No newline at end of file diff --git a/app/src/main/java/it/niedermann/owncloud/notes/android/fragment/about/AboutFragmentLicenseTab.java b/app/src/main/java/it/niedermann/owncloud/notes/android/fragment/about/AboutFragmentLicenseTab.java new file mode 100644 index 00000000..989c164e --- /dev/null +++ b/app/src/main/java/it/niedermann/owncloud/notes/android/fragment/about/AboutFragmentLicenseTab.java @@ -0,0 +1,16 @@ +package it.niedermann.owncloud.notes.android.fragment.about; + +import android.os.Bundle; +import android.support.v4.app.Fragment; +import android.view.LayoutInflater; +import android.view.View; +import android.view.ViewGroup; + +import it.niedermann.owncloud.notes.R; + +public class AboutFragmentLicenseTab extends Fragment { + @Override + public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { + return inflater.inflate(R.layout.fragment_about_license_tab, container, false); + } +}
\ No newline at end of file diff --git a/app/src/main/res/layout/activity_about.xml b/app/src/main/res/layout/activity_about.xml index 504b3ca3..5288d075 100644 --- a/app/src/main/res/layout/activity_about.xml +++ b/app/src/main/res/layout/activity_about.xml @@ -1,68 +1,148 @@ <?xml version="1.0" encoding="utf-8"?> + +<android.support.v4.app.FragmentTabHost + android:id="@android:id/tabhost" + xmlns:android="http://schemas.android.com/apk/res/android" + android:layout_width="match_parent" + android:layout_height="match_parent"> + + <LinearLayout + android:layout_width="match_parent" + android:layout_height="match_parent" + android:orientation="vertical"> + + <TabWidget + android:id="@android:id/tabs" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:layout_weight="0" + android:orientation="horizontal"/> + + <FrameLayout + android:id="@android:id/tabcontent" + android:layout_width="0dp" + android:layout_height="0dp" + android:layout_weight="0"/> + + <FrameLayout + android:id="@+id/realtabcontent" + android:layout_width="match_parent" + android:layout_height="0dp" + android:layout_weight="1"/> + + </LinearLayout> +</android.support.v4.app.FragmentTabHost> + + <!--<?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertical" android:padding="@dimen/activity_horizontal_margin"> - <TextView - android:id="@+id/about_version_title" - style="?android:attr/listSeparatorTextViewStyle" - android:layout_width="match_parent" - android:layout_height="wrap_content" - android:text="@string/about_version_title"/> - - <TextView - android:id="@+id/about_version" - style="?android:attr/editTextPreferenceStyle" - android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:padding="10dp" - android:text="@string/about_version"/> - - <TextView - android:id="@+id/about_author_title" - style="?android:attr/listSeparatorTextViewStyle" + <TabHost android:layout_width="match_parent" - android:layout_height="wrap_content" - android:text="@string/about_author_title"/> + android:layout_height="match_parent" + android:id="@+id/tabhost"> - <TextView - android:id="@+id/about_author" - style="?android:attr/editTextPreferenceStyle" - android:layout_width="match_parent" - android:layout_height="wrap_content" - android:padding="10dp" - android:text="@string/about_author"/> + <LinearLayout + android:layout_width="match_parent" + android:layout_height="match_parent" + android:orientation="vertical"> - <TextView - android:id="@+id/about_app_icon_disclaimer_title" - style="?android:attr/listSeparatorTextViewStyle" - android:layout_width="match_parent" - android:layout_height="wrap_content" - android:text="@string/about_app_icon_disclaimer_title"/> + <TabWidget + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:id="@+id/about_tabs"> + </TabWidget> - <TextView - android:id="@+id/about_app_icon_disclaimer" - style="?android:attr/editTextPreferenceStyle" - android:layout_width="match_parent" - android:layout_height="wrap_content" - android:padding="10dp" - android:text="@string/about_app_icon_disclaimer"/> + <FrameLayout + android:id="@android:id/tabcontent" + android:layout_width="match_parent" + android:layout_height="match_parent"> - <TextView - android:id="@+id/about_icons_disclaimer_title" - style="?android:attr/listSeparatorTextViewStyle" - android:layout_width="match_parent" - android:layout_height="wrap_content" - android:text="@string/about_icons_disclaimer_title"/> + <LinearLayout + android:id="@+id/linearLayout" + android:layout_width="match_parent" + android:layout_height="match_parent" + android:orientation="vertical"> - <TextView - android:id="@+id/about_icons_disclaimer" - style="?android:attr/editTextPreferenceStyle" - android:layout_width="match_parent" - android:layout_height="wrap_content" - android:padding="10dp" - android:text="@string/about_icons_disclaimer"/> + <TextView + android:id="@+id/about_version_title" + style="?android:attr/listSeparatorTextViewStyle" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:text="@string/about_version_title"/> + + <TextView + android:id="@+id/about_version" + style="?android:attr/editTextPreferenceStyle" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:padding="10dp" + android:text="@string/about_version"/> + + <TextView + android:id="@+id/about_author_title" + style="?android:attr/listSeparatorTextViewStyle" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:text="@string/about_author_title"/> + + <TextView + android:id="@+id/about_author" + style="?android:attr/editTextPreferenceStyle" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:padding="10dp" + android:text="@string/about_author"/> + + <TextView + android:id="@+id/about_app_icon_disclaimer_title" + style="?android:attr/listSeparatorTextViewStyle" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:text="@string/about_app_icon_disclaimer_title"/> + + <TextView + android:id="@+id/about_app_icon_disclaimer" + style="?android:attr/editTextPreferenceStyle" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:padding="10dp" + android:text="@string/about_app_icon_disclaimer"/> + + <TextView + android:id="@+id/about_icons_disclaimer_title" + style="?android:attr/listSeparatorTextViewStyle" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:text="@string/about_icons_disclaimer_title"/> + + <TextView + android:id="@+id/about_icons_disclaimer" + style="?android:attr/editTextPreferenceStyle" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:padding="10dp" + android:text="@string/about_icons_disclaimer"/> + </LinearLayout> + + <LinearLayout + android:id="@+id/linearLayout2" + android:layout_width="match_parent" + android:layout_height="match_parent" + android:orientation="vertical"> + </LinearLayout> + + <LinearLayout + android:id="@+id/linearLayout3" + android:layout_width="match_parent" + android:layout_height="match_parent" + android:orientation="vertical"> + </LinearLayout> + </FrameLayout> + </LinearLayout> + </TabHost> -</LinearLayout>
\ No newline at end of file +</LinearLayout-->
\ No newline at end of file diff --git a/app/src/main/res/layout/fragment_about_contribution_tab.xml b/app/src/main/res/layout/fragment_about_contribution_tab.xml new file mode 100644 index 00000000..f474ee60 --- /dev/null +++ b/app/src/main/res/layout/fragment_about_contribution_tab.xml @@ -0,0 +1,12 @@ +<?xml version="1.0" encoding="utf-8"?> +<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" + android:layout_width="match_parent" + android:layout_height="match_parent" + android:orientation="vertical" + android:padding="@dimen/activity_horizontal_margin"> + + <TextView + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:text="Contribute on Github.com"/> +</LinearLayout>
\ No newline at end of file diff --git a/app/src/main/res/layout/fragment_about_credentials_tab.xml b/app/src/main/res/layout/fragment_about_credentials_tab.xml new file mode 100644 index 00000000..cb4da7ec --- /dev/null +++ b/app/src/main/res/layout/fragment_about_credentials_tab.xml @@ -0,0 +1,12 @@ +<?xml version="1.0" encoding="utf-8"?> +<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" + android:layout_width="match_parent" + android:layout_height="match_parent" + android:orientation="vertical" + android:padding="@dimen/activity_horizontal_margin"> + + <TextView + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:text="Maintainer: Niedermann IT-Dienstleistungen"/> +</LinearLayout>
\ No newline at end of file diff --git a/app/src/main/res/layout/fragment_about_license_tab.xml b/app/src/main/res/layout/fragment_about_license_tab.xml new file mode 100644 index 00000000..bd9629f9 --- /dev/null +++ b/app/src/main/res/layout/fragment_about_license_tab.xml @@ -0,0 +1,12 @@ +<?xml version="1.0" encoding="utf-8"?> +<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" + android:layout_width="match_parent" + android:layout_height="match_parent" + android:orientation="vertical" + android:padding="@dimen/activity_horizontal_margin"> + + <TextView + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:text="This app is licensed under the GPLv2"/> +</LinearLayout>
\ No newline at end of file |