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 { ...@@ -41,11 +41,13 @@ repositories {
} }
dependencies { dependencies {
compile 'com.android.support:design:22.2.0'
compile 'com.android.support:appcompat-v7:22.2.0' compile 'com.android.support:appcompat-v7:22.2.0'
compile 'com.android.support:support-v13:22.2.0' compile 'com.android.support:support-v13:22.2.0'
compile 'com.github.ksoichiro:android-observablescrollview:1.5.0' compile 'com.github.ksoichiro:android-observablescrollview:1.5.0'
compile 'de.hdodenhof:circleimageview:1.2.2' compile 'de.hdodenhof:circleimageview:1.2.2'
compile 'com.melnykov:floatingactionbutton:1.2.0' compile 'com.melnykov:floatingactionbutton:1.2.0'
compile 'dnsjava:dnsjava:2.1.7' compile 'dnsjava:dnsjava:2.1.7'
compile 'com.github.bumptech.glide:glide:3.6.0'
compile project('otr4j') compile project('otr4j')
} }
...@@ -20,10 +20,13 @@ import android.content.pm.PackageInfo; ...@@ -20,10 +20,13 @@ import android.content.pm.PackageInfo;
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.CollapsingToolbarLayout;
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.view.View; import android.view.View;
import android.widget.ImageView;
import com.bumptech.glide.Glide;
import com.xabber.android.R; import com.xabber.android.R;
import com.xabber.android.ui.helper.ManagedActivity; import com.xabber.android.ui.helper.ManagedActivity;
...@@ -50,8 +53,16 @@ public class AboutViewer extends ManagedActivity implements View.OnClickListener ...@@ -50,8 +53,16 @@ public class AboutViewer extends ManagedActivity implements View.OnClickListener
findViewById(R.id.about_twitter).setOnClickListener(this); findViewById(R.id.about_twitter).setOnClickListener(this);
findViewById(R.id.about_redsolution).setOnClickListener(this); findViewById(R.id.about_redsolution).setOnClickListener(this);
// ((TextView) findViewById(R.id.about_version)) CollapsingToolbarLayout collapsingToolbar =
// .setText(getString(R.string.about_version, getVersionName())); (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() { private String getVersionName() {
......
...@@ -12,62 +12,91 @@ ...@@ -12,62 +12,91 @@
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/.
--> -->
<RelativeLayout <android.support.design.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android"
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_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:orientation="vertical" android:fitsSystemWindows="true">
>
<LinearLayout <android.support.design.widget.AppBarLayout
android:id="@+id/about_fake_toolbar" android:id="@+id/appbar"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="192dp"
android:background="?attr/colorPrimary" android:background="#212122"
android:elevation="8dp" android:elevation="8dp"
android:paddingBottom="16dp" android:fitsSystemWindows="true"
android:paddingTop="?attr/actionBarSize"> android:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar">
<ImageView <android.support.design.widget.CollapsingToolbarLayout
android:layout_width="wrap_content" android:id="@+id/collapsing_toolbar"
android:layout_height="wrap_content" android:layout_width="match_parent"
android:src="@drawable/ic_connect" /> android:layout_height="match_parent"
android:elevation="8dp"
<TextView android:fitsSystemWindows="true"
android:layout_width="wrap_content" app:collapsedTitleTextAppearance="@style/ToolbarTitle"
android:layout_height="wrap_content" app:contentScrim="#212122"
android:layout_gravity="bottom" app:expandedTitleMarginBottom="56dp"
android:text="X" app:expandedTitleMarginEnd="64dp"
android:textColor="@color/red_500" app:expandedTitleMarginStart="88dp"
android:textSize="56sp" /> app:expandedTitleTextAppearance="@style/CollapsingToolbarTitle"
app:layout_scrollFlags="scroll|exitUntilCollapsed">
<TextView
android:layout_width="wrap_content" <FrameLayout
android:layout_height="wrap_content" android:layout_width="match_parent"
android:layout_gravity="bottom" android:layout_height="match_parent"
android:text="abber" android:fitsSystemWindows="true"
android:textColor="@color/white" app:layout_collapseMode="parallax">
android:textSize="56sp" />
<ImageView
android:id="@+id/backdrop"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fitsSystemWindows="true"
android:scaleType="centerCrop"
</LinearLayout> />
<android.support.v7.widget.Toolbar xmlns:android="http://schemas.android.com/apk/res/android" <ImageView
xmlns:app="http://schemas.android.com/apk/res-auto" android:layout_width="wrap_content"
android:id="@+id/toolbar_default" android:layout_height="wrap_content"
android:layout_width="match_parent" android:layout_gravity="bottom"
android:layout_height="?attr/actionBarSize" android:paddingBottom="16dp"
android:paddingLeft="16dp"
android:src="@drawable/ic_connect" />
android:elevation="8dp" <TextView
android:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar" android:layout_width="wrap_content"
app:popupTheme="@style/ThemeOverlay.AppCompat.Light" android:layout_height="wrap_content"
app:titleTextAppearance="@style/ToolbarTitle" /> android:layout_gravity="bottom"
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" />
</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: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_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:layout_below="@id/about_fake_toolbar"> app:layout_behavior="@string/appbar_scrolling_view_behavior">
<LinearLayout <LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"
...@@ -263,6 +292,6 @@ ...@@ -263,6 +292,6 @@
</LinearLayout> </LinearLayout>
</ScrollView> </android.support.v4.widget.NestedScrollView>
</RelativeLayout> </android.support.design.widget.CoordinatorLayout>
\ No newline at end of file \ 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 @@ ...@@ -14,12 +14,18 @@
--> -->
<resources> <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 --> <!--for text selection toolbar to be above usual toolbar -->
<item name="windowActionModeOverlay">true</item> <item name="windowActionModeOverlay">true</item>
</style> </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 --> <!--for text selection toolbar to be above usual toolbar -->
<item name="windowActionModeOverlay">true</item> <item name="windowActionModeOverlay">true</item>
</style> </style>
...@@ -27,4 +33,14 @@ ...@@ -27,4 +33,14 @@
<style name="ToolbarTitle" parent="@style/TextAppearance.Widget.AppCompat.Toolbar.Title"> <style name="ToolbarTitle" parent="@style/TextAppearance.Widget.AppCompat.Toolbar.Title">
<item name="android:textSize">17sp</item> <item name="android:textSize">17sp</item>
</style> </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> </resources>
\ No newline at end of file
...@@ -65,7 +65,7 @@ ...@@ -65,7 +65,7 @@
android:key="@string/preference_about_key" android:key="@string/preference_about_key"
android:title="@string/preference_about"> android:title="@string/preference_about">
<intent <intent
android:targetClass="com.xabber.android.ui.preferences.AboutViewer" android:targetClass="com.xabber.android.ui.AboutViewer"
android:targetPackage="@string/application_package" /> android:targetPackage="@string/application_package" />
</Preference> </Preference>
</PreferenceScreen> </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