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;
......
This diff is collapsed.
<?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