Skip to content
Snippets Groups Projects
Commit 1c0e6738 authored by Aline Bonnet's avatar Aline Bonnet Committed by Hadrien De Sousa
Browse files

about: add missing elements


This commit adds two missing elements on the about screen:
- a short description of Ring
- the authors and artists list

Change-Id: Id141bfa77378449b08d165a7b32688fe34f45f19
Reviewed-by: default avatarHadrien De Sousa <hadrien.desousa@savoirfairelinux.com>
Tuleap: #1574
parent 2c1c57c2
No related branches found
No related tags found
No related merge requests found
/*
* Copyright (C) 2017 Savoir-faire Linux Inc.
*
* Author: Aline Bonnet <aline.bonnet@savoirfairelinux.com>
*
* 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, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
package cx.ring.about;
import android.app.Dialog;
import android.support.annotation.NonNull;
import android.support.design.widget.BottomSheetBehavior;
import android.support.design.widget.BottomSheetDialogFragment;
import android.support.design.widget.CoordinatorLayout;
import android.view.View;
import cx.ring.R;
public class AboutBottomSheetDialogFragment extends BottomSheetDialogFragment {
private BottomSheetBehavior.BottomSheetCallback mCallback = new BottomSheetBehavior.BottomSheetCallback() {
@Override
public void onStateChanged(@NonNull View bottomSheet, int newState) {
if (newState == BottomSheetBehavior.STATE_HIDDEN) {
dismiss();
}
}
@Override
public void onSlide(@NonNull View bottomSheet, float slideOffset) {
}
};
@Override
public void setupDialog(Dialog dialog, int style) {
super.setupDialog(dialog, style);
View contentView = View.inflate(getContext(), R.layout.dialog_about, null);
dialog.setContentView(contentView);
CoordinatorLayout.LayoutParams params = (CoordinatorLayout.LayoutParams) ((View) contentView.getParent()).getLayoutParams();
CoordinatorLayout.Behavior behavior = params.getBehavior();
if (behavior != null && behavior instanceof BottomSheetBehavior) {
((BottomSheetBehavior) behavior).setBottomSheetCallback(mCallback);
}
}
}
...@@ -24,14 +24,16 @@ import android.content.Intent; ...@@ -24,14 +24,16 @@ import android.content.Intent;
import android.content.pm.PackageManager; import android.content.pm.PackageManager;
import android.net.Uri; import android.net.Uri;
import android.os.Bundle; import android.os.Bundle;
import android.support.design.widget.BottomSheetDialogFragment;
import android.support.design.widget.Snackbar; import android.support.design.widget.Snackbar;
import android.support.v7.app.AppCompatActivity;
import android.text.Html; import android.text.Html;
import android.view.LayoutInflater; import android.view.LayoutInflater;
import android.view.Menu; import android.view.Menu;
import android.view.MenuInflater; import android.view.MenuInflater;
import android.view.MenuItem;
import android.view.View; import android.view.View;
import android.view.ViewGroup; import android.view.ViewGroup;
import android.widget.Button;
import android.widget.ImageView; import android.widget.ImageView;
import android.widget.TextView; import android.widget.TextView;
...@@ -75,6 +77,9 @@ public class AboutFragment extends Fragment implements AboutView { ...@@ -75,6 +77,9 @@ public class AboutFragment extends Fragment implements AboutView {
@BindView(R.id.logo) @BindView(R.id.logo)
ImageView mImageViewSFLLogo; ImageView mImageViewSFLLogo;
@BindView(R.id.credits)
Button mCredits;
private Unbinder mUnbinder; private Unbinder mUnbinder;
@Override @Override
...@@ -155,6 +160,12 @@ public class AboutFragment extends Fragment implements AboutView { ...@@ -155,6 +160,12 @@ public class AboutFragment extends Fragment implements AboutView {
launchSystemIntent(emailIntent, getString(R.string.email_chooser_title), getString(R.string.no_email_app_installed)); launchSystemIntent(emailIntent, getString(R.string.email_chooser_title), getString(R.string.no_email_app_installed));
} }
@OnClick(R.id.credits)
public void creditsClicked() {
BottomSheetDialogFragment dialog = new AboutBottomSheetDialogFragment();
dialog.show(((AppCompatActivity) getActivity()).getSupportFragmentManager(), dialog.getTag());
}
private void launchSystemIntent(Intent intentToLaunch, private void launchSystemIntent(Intent intentToLaunch,
String intentChooserTitle, String intentChooserTitle,
String intentMissingTitle) { String intentMissingTitle) {
......
<?xml version="1.0" encoding="utf-8"?>
<ScrollView 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="wrap_content"
android:orientation="vertical"
android:padding="@dimen/padding_medium">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="5dp"
android:layout_marginRight="5dp"
android:layout_marginTop="5dp"
android:text="@string/developed_by"
android:textColor="@color/color_primary_dark"
android:textSize="18sp" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginBottom="5dp"
android:layout_marginLeft="5dp"
android:layout_marginRight="5dp"
android:text="@string/credits_developer"
android:textAppearance="?android:attr/textAppearanceSmall" />
<View
android:layout_width="match_parent"
android:layout_height="1dp"
android:background="@color/darker_gray" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="5dp"
android:layout_marginRight="5dp"
android:layout_marginTop="5dp"
android:text="@string/designed_by"
android:textColor="@color/color_primary_dark"
android:textSize="18sp" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginBottom="5dp"
android:layout_marginLeft="5dp"
android:layout_marginRight="5dp"
android:text="@string/credits_designer"
android:textAppearance="?android:attr/textAppearanceSmall" />
</LinearLayout>
</ScrollView>
\ No newline at end of file
...@@ -21,7 +21,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. ...@@ -21,7 +21,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent"> android:layout_height="match_parent">
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" <LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:orientation="vertical" android:orientation="vertical"
...@@ -37,6 +37,14 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. ...@@ -37,6 +37,14 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
android:maxWidth="250dp" android:maxWidth="250dp"
android:scaleType="fitCenter" /> android:scaleType="fitCenter" />
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="16dp"
android:layout_marginTop="16dp"
android:text="@string/description"
android:textAlignment="center" />
<LinearLayout <LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
...@@ -68,9 +76,9 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. ...@@ -68,9 +76,9 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
android:id="@+id/contribute_container" android:id="@+id/contribute_container"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_margin="5dp"
android:background="?attr/selectableItemBackground" android:background="?attr/selectableItemBackground"
android:clickable="true" android:clickable="true"
android:layout_margin="5dp"
android:gravity="center_vertical" android:gravity="center_vertical"
android:orientation="vertical"> android:orientation="vertical">
...@@ -125,9 +133,9 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. ...@@ -125,9 +133,9 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
android:id="@+id/license_container" android:id="@+id/license_container"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_margin="5dp"
android:background="?attr/selectableItemBackground" android:background="?attr/selectableItemBackground"
android:clickable="true" android:clickable="true"
android:layout_margin="5dp"
android:gravity="center_vertical" android:gravity="center_vertical"
android:orientation="vertical"> android:orientation="vertical">
...@@ -209,5 +217,17 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. ...@@ -209,5 +217,17 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
</LinearLayout> </LinearLayout>
<android.support.v7.widget.AppCompatButton
android:id="@+id/credits"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:paddingLeft="24dp"
android:paddingRight="24dp"
android:text="@string/credits"
android:theme="@style/ButtonColoredInverse" />
</LinearLayout> </LinearLayout>
</ScrollView> </ScrollView>
...@@ -20,6 +20,7 @@ along with this program; if not, write to the Free Software ...@@ -20,6 +20,7 @@ along with this program; if not, write to the Free Software
--> -->
<resources> <resources>
<!-- About -->
<string name="app_name" translatable="false">Ring</string> <string name="app_name" translatable="false">Ring</string>
<string name="app_author" translatable="false">Savoir-faire Linux Inc.</string> <string name="app_author" translatable="false">Savoir-faire Linux Inc.</string>
<string name="app_release" translatable="false">Gaston Miron Beta 2 - %1$s</string> <string name="app_release" translatable="false">Gaston Miron Beta 2 - %1$s</string>
...@@ -41,6 +42,14 @@ along with this program; if not, write to the Free Software ...@@ -41,6 +42,14 @@ along with this program; if not, write to the Free Software
<string name="website_chooser_title">View website using…</string> <string name="website_chooser_title">View website using…</string>
<string name="license">This software is provided \"as is\", without warranty of any kind. For details, see <string name="license">This software is provided \"as is\", without warranty of any kind. For details, see
&lt;u>GNU General Public License version 3 or later&lt;/u></string> &lt;u>GNU General Public License version 3 or later&lt;/u></string>
<string name="description">Ring is free software for universal communication which respects the freedoms and privacy of its users.</string>
<string name="credits">Credits</string>
<!-- About dialog -->
<string name="developed_by">Developed by</string>
<string name="designed_by">Designed by</string>
<string name="credits_developer" translatable="false">Adrien Béraud\nAlexandr Sergheev\nAlexandre Lision\nAlexandre Viau\nAline Bonnet\nAndreas Traczyk\nAnthony Léonard\nCyrille Béraud\nEdric Milaret\nÉloi Bail\nEmmanuel Lepage-Vallée\nFrédéric Guimont\nGuillaume Roguez\nJulien Grossholtz\nLoïc Siret\nNicolas Jäger\nNicolas Reynaud\nOlivier Gregoire\nOlivier Soldano\nPatrick Keroulas\nPhilippe Gorley\nRomain Bertozzi\nSeva Ivanov\nSimon Désaulniers\nStepan Salenikovich\nSimon Zeni\nThibault Wittemberg\nBased on the SFLPhone project</string>
<string name="credits_designer" translatable="false">Marianne Forget</string>
<!-- RingActivity --> <!-- RingActivity -->
<string name="title_activity_sflphone_home">Ring</string> <string name="title_activity_sflphone_home">Ring</string>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment