Commit 30d23b00 authored by Grigory Fedorov's avatar Grigory Fedorov

AboutViewer: dark theme, new layout, links to twitter, github,...

AboutViewer: dark theme, new layout, links to twitter, github, redsolution.com, etc. New icons and pictures for these links.
ActivityManager: app theme is NOT applied to every managed activity. Theme set in manifest.
parent d5d31d71
...@@ -73,9 +73,10 @@ ...@@ -73,9 +73,10 @@
android:name="com.xabber.android.ui.LoadActivity" android:name="com.xabber.android.ui.LoadActivity"
/> />
<activity <activity
android:name="com.xabber.android.ui.preferences.AboutViewer" android:name=".ui.AboutViewer"
android:label="@string/about_viewer" android:label="@string/about_viewer"
android:parentActivityName="com.xabber.android.ui.preferences.PreferenceEditor" android:parentActivityName="com.xabber.android.ui.preferences.PreferenceEditor"
android:theme="@style/ThemeDark"
> >
<!-- Parent activity meta-data to support 4.0 and lower --> <!-- Parent activity meta-data to support 4.0 and lower -->
......
...@@ -132,7 +132,6 @@ public class ActivityManager implements OnUnloadListener { ...@@ -132,7 +132,6 @@ public class ActivityManager implements OnUnloadListener {
public void onCreate(Activity activity) { public void onCreate(Activity activity) {
if (LOG) if (LOG)
LogManager.i(activity, "onCreate: " + activity.getIntent()); LogManager.i(activity, "onCreate: " + activity.getIntent());
applyTheme(activity);
if (application.isClosing() && !(activity instanceof LoadActivity)) { if (application.isClosing() && !(activity instanceof LoadActivity)) {
activity.startActivity(LoadActivity.createIntent(activity)); activity.startActivity(LoadActivity.createIntent(activity));
activity.finish(); activity.finish();
......
/** /**
* Copyright (c) 2013, Redsolution LTD. All rights reserved. * Copyright (c) 2013, Redsolution LTD. All rights reserved.
* * <p/>
* This file is part of Xabber project; you can redistribute it and/or * This file is part of Xabber project; you can redistribute it and/or
* modify it under the terms of the GNU General Public License, Version 3. * modify it under the terms of the GNU General Public License, Version 3.
* * <p/>
* Xabber is distributed in the hope that it will be useful, but * Xabber is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of * WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
* See the GNU General Public License for more details. * See the GNU General Public License for more details.
* * <p/>
* You should have received a copy of the GNU General Public License, * You should have received a copy of the GNU General Public License,
* along with this program. If not, see http://www.gnu.org/licenses/. * along with this program. If not, see http://www.gnu.org/licenses/.
*/ */
package com.xabber.android.ui.preferences; package com.xabber.android.ui;
import android.content.Context; import android.content.Context;
import android.content.Intent; import android.content.Intent;
import android.content.pm.PackageInfo; import android.content.pm.PackageInfo;
import android.content.pm.PackageManager; import android.content.pm.PackageManager;
import android.net.Uri;
import android.os.Bundle; import android.os.Bundle;
import android.support.v4.app.NavUtils; import android.support.v4.app.NavUtils;
import android.support.v7.widget.Toolbar; import android.support.v7.widget.Toolbar;
import android.text.method.LinkMovementMethod; import android.view.View;
import android.view.MenuItem;
import android.widget.TextView;
import com.xabber.android.R; import com.xabber.android.R;
import com.xabber.android.ui.helper.BarPainter;
import com.xabber.android.ui.helper.ManagedActivity; import com.xabber.android.ui.helper.ManagedActivity;
public class AboutViewer extends ManagedActivity { public class AboutViewer extends ManagedActivity implements View.OnClickListener {
public static Intent createIntent(Context context) { public static Intent createIntent(Context context) {
return new Intent(context, AboutViewer.class); return new Intent(context, AboutViewer.class);
...@@ -40,17 +38,20 @@ public class AboutViewer extends ManagedActivity { ...@@ -40,17 +38,20 @@ public class AboutViewer extends ManagedActivity {
super.onCreate(savedInstanceState); super.onCreate(savedInstanceState);
setContentView(R.layout.about_viewer); setContentView(R.layout.about_viewer);
Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar_default); Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar_default);
setSupportActionBar(toolbar); toolbar.setNavigationIcon(R.drawable.ic_arrow_left_white_24dp);
toolbar.setNavigationOnClickListener(new View.OnClickListener() {
BarPainter barPainter = new BarPainter(this, toolbar); @Override
barPainter.setDefaultColor(); public void onClick(View v) {
NavUtils.navigateUpFromSameTask(AboutViewer.this);
}
});
((TextView) findViewById(R.id.about_version)) findViewById(R.id.about_github).setOnClickListener(this);
.setText(getString(R.string.about_version, getVersionName())); findViewById(R.id.about_twitter).setOnClickListener(this);
((TextView) findViewById(R.id.about_license)) findViewById(R.id.about_redsolution).setOnClickListener(this);
.setMovementMethod(LinkMovementMethod.getInstance());
getSupportActionBar().setDisplayHomeAsUpEnabled(true); // ((TextView) findViewById(R.id.about_version))
// .setText(getString(R.string.about_version, getVersionName()));
} }
private String getVersionName() { private String getVersionName() {
...@@ -64,14 +65,27 @@ public class AboutViewer extends ManagedActivity { ...@@ -64,14 +65,27 @@ public class AboutViewer extends ManagedActivity {
} }
@Override @Override
public boolean onOptionsItemSelected(MenuItem item) { public void onClick(View v) {
switch (item.getItemId()) {
// Respond to the action bar's Up/Home button switch (v.getId()) {
case android.R.id.home: case R.id.about_redsolution:
NavUtils.navigateUpFromSameTask(this); sendUrlViewIntent(getString(R.string.about_redsolution_url));
return true; break;
case R.id.about_github:
sendUrlViewIntent(getString(R.string.about_xabber_github_url));
break;
case R.id.about_twitter:
sendUrlViewIntent(getString(R.string.about_xabber_twitter_url));
break;
} }
return super.onOptionsItemSelected(item);
} }
private void sendUrlViewIntent(String url) {
Intent i = new Intent(Intent.ACTION_VIEW);
i.setData(Uri.parse(url));
startActivity(i);
}
} }
...@@ -64,7 +64,6 @@ import com.xabber.android.ui.dialog.ContactIntegrationDialogFragment; ...@@ -64,7 +64,6 @@ import com.xabber.android.ui.dialog.ContactIntegrationDialogFragment;
import com.xabber.android.ui.dialog.StartAtBootDialogFragment; import com.xabber.android.ui.dialog.StartAtBootDialogFragment;
import com.xabber.android.ui.helper.BarPainter; import com.xabber.android.ui.helper.BarPainter;
import com.xabber.android.ui.helper.ManagedActivity; import com.xabber.android.ui.helper.ManagedActivity;
import com.xabber.android.ui.preferences.AboutViewer;
import com.xabber.android.ui.preferences.AccountEditor; import com.xabber.android.ui.preferences.AccountEditor;
import com.xabber.android.ui.preferences.AccountList; import com.xabber.android.ui.preferences.AccountList;
import com.xabber.android.ui.preferences.PreferenceEditor; import com.xabber.android.ui.preferences.PreferenceEditor;
......
...@@ -12,82 +12,257 @@ ...@@ -12,82 +12,257 @@
You should have received a copy of the GNU General Public License, You should have received a copy of the GNU General Public License,
along with this program. If not, see http://www.gnu.org/licenses/. along with this program. If not, see http://www.gnu.org/licenses/.
--> -->
<LinearLayout <RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android" xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:gravity="center_horizontal"
android:orientation="vertical" android:orientation="vertical"
> >
<include layout="@layout/toolbar_default"/>
<LinearLayout <LinearLayout
android:id="@+id/about_fake_toolbar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="?attr/colorPrimary"
android:elevation="8dp"
android:paddingBottom="16dp"
android:paddingTop="?attr/actionBarSize">
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@drawable/ic_connect" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="bottom"
android:text="X"
android:textColor="@color/red_500"
android:textSize="56sp" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="bottom"
android:text="abber"
android:textColor="@color/white"
android:textSize="56sp" />
</LinearLayout>
<android.support.v7.widget.Toolbar xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/toolbar_default"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:elevation="8dp"
android:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar"
app:popupTheme="@style/ThemeOverlay.AppCompat.Light"
app:titleTextAppearance="@style/ToolbarTitle" />
<ScrollView
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:layout_weight="1" android:layout_below="@id/about_fake_toolbar">
android:gravity="center"
android:orientation="vertical"> <LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:padding="16dp">
<Space
android:layout_width="match_parent"
android:layout_height="8dp" />
<TextView
android:id="@+id/about_header_about"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/about_about"
android:textAppearance="?android:attr/textAppearanceLarge" />
<Space
android:layout_width="match_parent"
android:layout_height="16dp" />
<TextView
android:id="@+id/about_text_about"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat"
android:textAppearance="?android:attr/textAppearanceMedium" />
<Space
android:layout_width="match_parent"
android:layout_height="24dp" />
<TextView
android:id="@+id/about_header_developers"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/about_developers"
android:textAppearance="?android:attr/textAppearanceLarge" />
<Space
android:layout_width="match_parent"
android:layout_height="16dp" />
<ImageView <ImageView
android:id="@+id/avatar" android:id="@+id/about_redsolution"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginBottom="5dip" android:paddingBottom="8dp"
android:src="@drawable/ic_connect" android:paddingRight="8dp"
/> android:src="@drawable/redsolution_logo" />
<TextView <TextView
android:id="@+id/about_text_developers"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:paddingBottom="8dip" android:text="Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequatt"
android:paddingTop="8dip" android:textAppearance="?android:attr/textAppearanceMedium" />
android:text="@string/application_title_full"
android:textColor="?android:attr/textColorPrimary" <Space
android:textSize="15sp" android:layout_width="match_parent"
android:textStyle="bold" android:layout_height="16dp" />
/>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
<TextView <TextView
android:id="@+id/about_version" android:id="@+id/about_xabber_site"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:paddingBottom="8dip" android:autoLink="web"
android:textColor="?android:attr/textColorPrimary" android:text="@string/about_xabber_url"
/> android:textAppearance="?android:attr/textAppearanceSmall"
android:textColorLink="@color/white" />
<Space
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1" />
<TextView <TextView
android:id="@+id/about_xabber_email"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:autoLink="all" android:autoLink="email"
android:gravity="center" android:text="@string/about_xabber_email"
android:paddingBottom="8dip" android:textAppearance="?android:attr/textAppearanceSmall"
android:text="@string/about_site" android:textColorLink="@color/white" />
android:textColor="?android:attr/textColorPrimary" </LinearLayout>
android:textColorLink="#0099FF"
/> <Space
android:layout_width="match_parent"
android:layout_height="24dp" />
<TextView <TextView
android:id="@+id/about_header_follow_us"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:autoLink="all" android:text="@string/about_follow_us"
android:gravity="center" android:textAppearance="?android:attr/textAppearanceLarge" />
android:paddingBottom="8dip"
android:text="@string/about_feedback" <Space
android:textColor="?android:attr/textColorPrimary" android:layout_width="match_parent"
android:textColorLink="#0099FF" android:layout_height="16dp" />
/>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
<ImageView
android:id="@+id/about_twitter"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingRight="8dp"
android:paddingTop="8dp"
android:src="@drawable/ic_twitter" />
<ImageView
android:id="@+id/about_github"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingLeft="8dp"
android:paddingTop="8dp"
android:src="@drawable/ic_github" />
<Space
android:layout_width="16dp"
android:layout_height="wrap_content" />
<TextView
android:id="@+id/about_text_follow_us"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna."
android:textAppearance="?android:attr/textAppearanceMedium" />
</LinearLayout> </LinearLayout>
<Space
android:layout_width="match_parent"
android:layout_height="24dp" />
<TextView
android:id="@+id/textView4"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Something else"
android:textAppearance="?android:attr/textAppearanceLarge" />
<Space
android:layout_width="match_parent"
android:layout_height="16dp" />
<TextView
android:id="@+id/textView6"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat"
android:textAppearance="?android:attr/textAppearanceMedium" />
<Space
android:layout_width="match_parent"
android:layout_height="16dp" />
<TextView <TextView
android:id="@+id/about_license" android:id="@+id/about_license"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:gravity="center" android:gravity="center"
android:paddingBottom="8dip"
android:text="@string/about_license" android:text="@string/about_license"
android:textColor="?android:attr/textColorPrimary" android:textColor="@color/white" />
android:textColorLink="#0099FF"
/>
<TextView <TextView
android:id="@+id/about_open_source"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:paddingBottom="4dip" android:layout_gravity="center_horizontal"
android:gravity="center"
android:paddingBottom="8dp"
android:text="@string/about_open_source_software"
android:textColor="@color/white" />
<TextView
android:id="@+id/about_copyright"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:text="@string/about_copyright" android:text="@string/about_copyright"
android:textColor="?android:attr/textColorPrimary" android:textColor="@color/white" />
android:textColorLink="#0099FF" />
</LinearLayout> </LinearLayout>
\ No newline at end of file
</ScrollView>
</RelativeLayout>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<resources> <resources>
<!-- http://dl.dropbox.com/u/1029995/com.xabber.android/about_viewer.png -->
<string name="about_copyright">© Redsolution LTD, 2010–2015</string>
<!-- http://dl.dropbox.com/u/1029995/com.xabber.android/about_viewer.png -->
<string name="about_feedback">mailto:info@xabber.com</string>
<!-- http://dl.dropbox.com/u/1029995/com.xabber.android/about_viewer.png -->
<string name="about_site">http://www.xabber.com</string>
<!-- http://dl.dropbox.com/u/1029995/com.xabber.android/about_viewer.png -->
<string name="about_version">Версия: %s</string> <string name="about_version">Версия: %s</string>
<string name="about_license">Лицензия: GNU GPLv3\n<a href="https://github.com/redsolution/xabber-android">Программное обеспечение с открытым исходным кодом</a></string>
<string name="about_open_source_xmpp_client">open source XMPP client</string> <string name="about_open_source_xmpp_client">open source XMPP client</string>
<string name="about_about">О программе</string>
<string name="about_developers">Разработчики</string>
<string name="about_redsolution_url">http://www.redsolution.com/</string>
<string name="about_xabber_url">http://www.xabber.com</string>
<string name="about_xabber_email">info@xabber.com</string>
<string name="about_follow_us">Подпишитесь</string>
<string name="about_xabber_twitter_url">https://twitter.com/xabber_xmpp</string>
<string name="about_xabber_github_url">https://github.com/redsolution/xabber-android</string>
<string name="about_copyright">© Redsolution LTD, 2010–2015</string>
<string name="about_license">Лицензия: GNU GPLv3</string>
<string name="about_open_source_software">Программное обеспечение с открытым исходным кодом</string>
</resources> </resources>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<resources> <resources>
<!-- http://dl.dropbox.com/u/1029995/com.xabber.android/about_viewer.png -->
<string name="about_copyright">© Redsolution LTD, 2010–2015</string>
<!-- http://dl.dropbox.com/u/1029995/com.xabber.android/about_viewer.png -->
<string name="about_feedback">mailto:info@xabber.com</string>
<!-- http://dl.dropbox.com/u/1029995/com.xabber.android/about_viewer.png -->
<string name="about_site">http://www.xabber.com</string>
<!-- http://dl.dropbox.com/u/1029995/com.xabber.android/about_viewer.png -->
<string name="about_version">Version: %s</string> <string name="about_version">Version: %s</string>
<string name="about_license">License: GNU GPLv3\n<a href="https://github.com/redsolution/xabber-android">Open source software</a></string>
<string name="about_open_source_xmpp_client">open source XMPP client</string> <string name="about_open_source_xmpp_client">open source XMPP client</string>
<string name="about_about">About</string>
<string name="about_developers">Developers</string>
<string name="about_redsolution_url">http://www.redsolution.com/</string>
<string name="about_xabber_url">http://www.xabber.com</string>
<string name="about_xabber_email">info@xabber.com</string>
<string name="about_follow_us">Follow us</string>
<string name="about_xabber_twitter_url">https://twitter.com/xabber_xmpp</string>
<string name="about_xabber_github_url">https://github.com/redsolution/xabber-android</string>
<string name="about_copyright">© Redsolution LTD, 2010–2015</string>
<string name="about_license">License: GNU GPLv3</string>
<string name="about_open_source_software">Open source software</string>
</resources> </resources>
\ No newline at end of file
...@@ -13,10 +13,13 @@ ...@@ -13,10 +13,13 @@
along with this program. If not, see http://www.gnu.org/licenses/. along with this program. If not, see http://www.gnu.org/licenses/.
--> -->
<resources> <resources>
<style name="Theme" parent="Theme.AppCompat.Light.DarkActionBar">
<item name="windowActionBar">false</item>
<item name="windowNoTitle">true</item>
<style name="Theme" parent="Theme.AppCompat.Light.NoActionBar">
<!--for text selection toolbar to be above usual toolbar -->
<item name="windowActionModeOverlay">true</item>
</style>
<style name="ThemeDark" parent="Theme.AppCompat.NoActionBar">
<!--for text selection toolbar to be above usual toolbar --> <!--for text selection toolbar to be above usual toolbar -->
<item name="windowActionModeOverlay">true</item> <item name="windowActionModeOverlay">true</item>
</style> </style>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment