Commit b2b57b9c authored by Grigory Fedorov's avatar Grigory Fedorov

About screen: scroll animation implemented using new Google Support Design library.

parent f1010d29
......@@ -41,11 +41,13 @@ repositories {
}
dependencies {
compile 'com.android.support:design:22.2.0'
compile 'com.android.support:appcompat-v7:22.2.0'
compile 'com.android.support:support-v13:22.2.0'
compile 'com.github.ksoichiro:android-observablescrollview:1.5.0'
compile 'de.hdodenhof:circleimageview:1.2.2'
compile 'com.melnykov:floatingactionbutton:1.2.0'
compile 'dnsjava:dnsjava:2.1.7'
compile 'com.github.bumptech.glide:glide:3.6.0'
compile project('otr4j')
}
......@@ -20,10 +20,13 @@ import android.content.pm.PackageInfo;
import android.content.pm.PackageManager;
import android.net.Uri;
import android.os.Bundle;
import android.support.design.widget.CollapsingToolbarLayout;
import android.support.v4.app.NavUtils;
import android.support.v7.widget.Toolbar;
import android.view.View;
import android.widget.ImageView;
import com.bumptech.glide.Glide;
import com.xabber.android.R;
import com.xabber.android.ui.helper.ManagedActivity;
......@@ -50,8 +53,16 @@ public class AboutViewer extends ManagedActivity implements View.OnClickListener
findViewById(R.id.about_twitter).setOnClickListener(this);
findViewById(R.id.about_redsolution).setOnClickListener(this);
// ((TextView) findViewById(R.id.about_version))
// .setText(getString(R.string.about_version, getVersionName()));
CollapsingToolbarLayout collapsingToolbar =
(CollapsingToolbarLayout) findViewById(R.id.collapsing_toolbar);
collapsingToolbar.setTitle("Xabber");
loadBackdrop();
}
private void loadBackdrop() {
final ImageView imageView = (ImageView) findViewById(R.id.backdrop);
Glide.with(this).load(R.drawable.about_backdrop).centerCrop().into(imageView);
}
private String getVersionName() {
......
......@@ -12,62 +12,91 @@
You should have received a copy of the GNU General Public License,
along with this program. If not, see http://www.gnu.org/licenses/.
-->
<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
<android.support.design.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/main_content"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
>
android:fitsSystemWindows="true">
<LinearLayout
android:id="@+id/about_fake_toolbar"
<android.support.design.widget.AppBarLayout
android:id="@+id/appbar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="?attr/colorPrimary"
android:layout_height="192dp"
android:background="#212122"
android:elevation="8dp"
android:paddingBottom="16dp"
android:paddingTop="?attr/actionBarSize">
android:fitsSystemWindows="true"
android:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar">
<android.support.design.widget.CollapsingToolbarLayout
android:id="@+id/collapsing_toolbar"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:elevation="8dp"
android:fitsSystemWindows="true"
app:collapsedTitleTextAppearance="@style/ToolbarTitle"
app:contentScrim="#212122"
app:expandedTitleMarginBottom="56dp"
app:expandedTitleMarginEnd="64dp"
app:expandedTitleMarginStart="88dp"
app:expandedTitleTextAppearance="@style/CollapsingToolbarTitle"
app:layout_scrollFlags="scroll|exitUntilCollapsed">
<FrameLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fitsSystemWindows="true"
app:layout_collapseMode="parallax">
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@drawable/ic_connect" />
android:id="@+id/backdrop"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fitsSystemWindows="true"
android:scaleType="centerCrop"
<TextView
/>
<ImageView
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" />
android:paddingBottom="16dp"
android:paddingLeft="16dp"
android:src="@drawable/ic_connect" />
<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" />
android:layout_marginBottom="36dp"
android:layout_marginLeft="88dp"
android:shadowColor="@color/grey_700"
android:shadowDx="1"
android:shadowDy="1"
android:shadowRadius="2"
android:text="@string/about_open_source_xmpp_client"
android:textColor="@color/green_50" />
</LinearLayout>
</FrameLayout>
<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" />
app:layout_collapseMode="pin"
app:popupTheme="@style/ThemeOverlay.AppCompat.Light" />
</android.support.design.widget.CollapsingToolbarLayout>
</android.support.design.widget.AppBarLayout>
<ScrollView
<android.support.v4.widget.NestedScrollView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_below="@id/about_fake_toolbar">
app:layout_behavior="@string/appbar_scrolling_view_behavior">
<LinearLayout
android:layout_width="match_parent"
......@@ -263,6 +292,6 @@
</LinearLayout>
</ScrollView>
</android.support.v4.widget.NestedScrollView>
</RelativeLayout>
\ No newline at end of file
</android.support.design.widget.CoordinatorLayout>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<resources>
<style name="ThemeDark" parent="Base.ThemeDark">
<item name="android:windowDrawsSystemBarBackgrounds">true</item>
<item name="android:statusBarColor">@android:color/transparent</item>
</style>
</resources>
\ No newline at end of file
......@@ -14,12 +14,18 @@
-->
<resources>
<style name="Theme" parent="Theme.AppCompat.Light.NoActionBar">
<style name="Theme" parent="Theme.AppCompat.Light.DarkActionBar">
<item name="windowActionBar">false</item>
<item name="windowNoTitle">true</item>
<!--for text selection toolbar to be above usual toolbar -->
<item name="windowActionModeOverlay">true</item>
</style>
<style name="ThemeDark" parent="Theme.AppCompat.NoActionBar">
<style name="ThemeDark" parent="Base.ThemeDark"></style>
<style name="Base.ThemeDark" parent="Theme.AppCompat.NoActionBar">
<!--for text selection toolbar to be above usual toolbar -->
<item name="windowActionModeOverlay">true</item>
</style>
......@@ -27,4 +33,14 @@
<style name="ToolbarTitle" parent="@style/TextAppearance.Widget.AppCompat.Toolbar.Title">
<item name="android:textSize">17sp</item>
</style>
<style name="CollapsingToolbarTitle" parent="@style/TextAppearance.Widget.AppCompat.Toolbar.Title">
<item name="android:textSize">32sp</item>
<item name="android:shadowColor">@color/grey_700</item>
<item name="android:shadowDx">10</item>
<item name="android:shadowDy">10</item>
<item name="android:shadowRadius">20</item>
<item name="android:textColor">@color/grey_50</item>
</style>
</resources>
\ No newline at end of file
......@@ -65,7 +65,7 @@
android:key="@string/preference_about_key"
android:title="@string/preference_about">
<intent
android:targetClass="com.xabber.android.ui.preferences.AboutViewer"
android:targetClass="com.xabber.android.ui.AboutViewer"
android:targetPackage="@string/application_package" />
</Preference>
</PreferenceScreen>
\ No newline at end of file
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