Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
thomaskioko committed Oct 5, 2018
2 parents d1b990b + d09b221 commit eca503e
Show file tree
Hide file tree
Showing 29 changed files with 568 additions and 21 deletions.
6 changes: 5 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ This is a demo project demonstrating how to use motion layout
Android Studio canary or stable version >= 3.2 is required and may be downloaded
[here](https://developer.android.com/studio/archive).

### Twitter Profile UI
## Splash Screen Demo

![Alt Text](art/SplashScreen.gif)

## Twitter Profile UI

![Alt Text](art/MotionLayout.gif)
20 changes: 10 additions & 10 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -24,18 +24,18 @@ android {

dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation"org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
implementation 'androidx.appcompat:appcompat:1.0.0-rc02'
implementation 'android.arch.navigation:navigation-fragment:1.0.0-alpha05'
implementation 'android.arch.navigation:navigation-ui:1.0.0-alpha05'
implementation 'android.arch.navigation:navigation-fragment-ktx:1.0.0-alpha05'
implementation 'android.arch.navigation:navigation-ui-ktx:1.0.0-alpha05'
implementation 'androidx.core:core-ktx:1.0.0-rc02'
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
implementation 'androidx.appcompat:appcompat:1.0.0'
implementation 'android.arch.navigation:navigation-fragment:1.0.0-alpha06'
implementation 'android.arch.navigation:navigation-ui:1.0.0-alpha06'
implementation 'android.arch.navigation:navigation-fragment-ktx:1.0.0-alpha06'
implementation 'android.arch.navigation:navigation-ui-ktx:1.0.0-alpha06'
implementation 'androidx.core:core-ktx:1.0.0'
implementation 'androidx.constraintlayout:constraintlayout:2.0.0-alpha2'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'androidx.test:runner:1.1.0-alpha4'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.0-alpha4'
androidTestImplementation 'androidx.test:runner:1.1.0-beta01'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.0-beta01'

implementation 'androidx.legacy:legacy-support-v4:1.0.0-rc02'
implementation 'androidx.legacy:legacy-support-v4:1.0.0'

}
4 changes: 3 additions & 1 deletion app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,15 @@
android:supportsRtl="true"
android:theme="@style/AppTheme"
tools:ignore="GoogleAppIndexingWarning">
<activity android:name=".MainActivity">
<activity android:name=".SplashScreenActivity"/>
<activity android:name=".MovieDetailActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN" />

<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity android:name=".MainActivity" />
</application>

</manifest>
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package com.thomaskioko.materialmotion
import androidx.appcompat.app.AppCompatActivity
import android.os.Bundle
import androidx.recyclerview.widget.LinearLayoutManager
import com.thomaskioko.materialmotion.adapter.TweetsAdapter
import kotlinx.android.synthetic.main.activity_main.*

class MainActivity : AppCompatActivity() {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
package com.thomaskioko.materialmotion

import android.os.Bundle
import android.view.WindowManager
import androidx.appcompat.app.AppCompatActivity
import androidx.recyclerview.widget.LinearLayoutManager
import com.thomaskioko.materialmotion.adapter.EpisodeAdapter
import kotlinx.android.synthetic.main.activity_movie_detail.*

class MovieDetailActivity : AppCompatActivity() {

override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_movie_detail)

window.setFlags(WindowManager.LayoutParams.FLAG_LAYOUT_NO_LIMITS,
WindowManager.LayoutParams.FLAG_LAYOUT_NO_LIMITS)

recycler_view_episodes.apply {
adapter = EpisodeAdapter()
layoutManager = LinearLayoutManager(this@MovieDetailActivity)
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
package com.thomaskioko.materialmotion

import android.os.Bundle
import androidx.appcompat.app.AppCompatActivity
import kotlinx.android.synthetic.main.activity_splash_screen.*

class SplashScreenActivity : AppCompatActivity() {

override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_splash_screen)

//Start the animation
motion_layout_intro.transitionToEnd()
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
package com.thomaskioko.materialmotion.adapter

import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import androidx.recyclerview.widget.RecyclerView
import com.thomaskioko.materialmotion.R

class EpisodeAdapter : RecyclerView.Adapter<EpisodeAdapter.ViewHolder>() {

override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): ViewHolder {
return ViewHolder(LayoutInflater.from(parent.context).inflate(R.layout.item_episode_layout, parent, false))
}

override fun getItemCount(): Int = 50

override fun onBindViewHolder(holder: ViewHolder, position: Int) {}

class ViewHolder(view: View) : RecyclerView.ViewHolder(view)
}
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
package com.thomaskioko.materialmotion
package com.thomaskioko.materialmotion.adapter

import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import androidx.recyclerview.widget.RecyclerView
import com.thomaskioko.materialmotion.R

class TweetsAdapter : RecyclerView.Adapter<TweetsAdapter.ViewHolder>() {

Expand Down
Binary file added app/src/main/res/drawable-nodpi/backdrop.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 5 additions & 0 deletions app/src/main/res/drawable/ic_access_time_black_24dp.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<vector android:height="24dp" android:tint="#505b5b5b"
android:viewportHeight="24.0" android:viewportWidth="24.0"
android:width="24dp" xmlns:android="http://schemas.android.com/apk/res/android">
<path android:fillColor="#FF000000" android:pathData="M11.99,2C6.47,2 2,6.48 2,12s4.47,10 9.99,10C17.52,22 22,17.52 22,12S17.52,2 11.99,2zM12,20c-4.42,0 -8,-3.58 -8,-8s3.58,-8 8,-8 8,3.58 8,8 -3.58,8 -8,8zM12.5,7H11v6l5.25,3.15 0.75,-1.23 -4.5,-2.67z"/>
</vector>
5 changes: 5 additions & 0 deletions app/src/main/res/drawable/ic_chat_black_24dp.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<vector android:height="24dp" android:tint="#D35D44"
android:viewportHeight="24.0" android:viewportWidth="24.0"
android:width="24dp" xmlns:android="http://schemas.android.com/apk/res/android">
<path android:fillColor="#FFFF" android:pathData="M20,2L4,2c-1.1,0 -1.99,0.9 -1.99,2L2,22l4,-4h14c1.1,0 2,-0.9 2,-2L22,4c0,-1.1 -0.9,-2 -2,-2zM6,9h12v2L6,11L6,9zM14,14L6,14v-2h8v2zM18,8L6,8L6,6h12v2z"/>
</vector>
5 changes: 5 additions & 0 deletions app/src/main/res/drawable/ic_more_vert_black_24dp.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<vector android:height="24dp" android:tint="#8899A6"
android:viewportHeight="24.0" android:viewportWidth="24.0"
android:width="24dp" xmlns:android="http://schemas.android.com/apk/res/android">
<path android:fillColor="#FF000000" android:pathData="M12,8c1.1,0 2,-0.9 2,-2s-0.9,-2 -2,-2 -2,0.9 -2,2 0.9,2 2,2zM12,10c-1.1,0 -2,0.9 -2,2s0.9,2 2,2 2,-0.9 2,-2 -0.9,-2 -2,-2zM12,16c-1.1,0 -2,0.9 -2,2s0.9,2 2,2 2,-0.9 2,-2 -0.9,-2 -2,-2z"/>
</vector>
5 changes: 5 additions & 0 deletions app/src/main/res/drawable/ic_play_arrow_black_24dp.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<vector android:height="24dp" android:tint="#FFFFFF"
android:viewportHeight="24.0" android:viewportWidth="24.0"
android:width="24dp" xmlns:android="http://schemas.android.com/apk/res/android">
<path android:fillColor="#FF000000" android:pathData="M8,5v14l11,-7z"/>
</vector>
Binary file added app/src/main/res/drawable/ic_twitter_logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/src/main/res/font/fjalla_one.ttf
Binary file not shown.
Binary file added app/src/main/res/font/squada_one.ttf
Binary file not shown.
167 changes: 167 additions & 0 deletions app/src/main/res/layout/activity_movie_detail.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,167 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.motion.widget.MotionLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/motion_layout_movie_detail"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/white"
android:fitsSystemWindows="true"
app:layoutDescription="@xml/scene_movie_detail"
tools:context=".MovieDetailActivity">

<androidx.appcompat.widget.AppCompatImageView
android:id="@+id/iv_backdrop"
android:layout_width="wrap_content"
android:layout_height="@dimen/dimen_backdrop_image"
android:scaleType="centerCrop"
android:src="@drawable/backdrop"
android:fitsSystemWindows="true" />

<com.google.android.material.floatingactionbutton.FloatingActionButton
android:id="@+id/fab_stream"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="8dp"
android:layout_marginEnd="8dp"
android:src="@drawable/ic_play_arrow_black_24dp"
android:tint="@color/orange"
app:backgroundTint="@color/white"
app:layout_constraintBottom_toBottomOf="@+id/iv_backdrop"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toBottomOf="@+id/iv_backdrop" />


<androidx.cardview.widget.CardView
android:id="@+id/card_view_meta_data"
android:layout_width="0dp"
android:layout_height="wrap_content"
app:cardCornerRadius="0dp"
app:cardPreventCornerOverlap="true"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/iv_backdrop">

<androidx.constraintlayout.widget.ConstraintLayout
android:id="@+id/cl_meta_data"
android:layout_width="match_parent"
android:layout_height="wrap_content">

<View
android:id="@+id/view"
android:layout_width="match_parent"
android:layout_height="60dp"
android:background="@color/orange"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />

<TextView
android:id="@+id/tv_episode_name"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="8dp"
android:fontFamily="@font/fjalla_one"
android:text="@string/tv_ep_title"
android:textColor="@color/white"
android:textSize="18sp"
app:layout_constraintBottom_toBottomOf="@+id/view"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="@+id/view" />

<TextView
android:id="@+id/tv_rating"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="16dp"
android:fontFamily="@font/squada_one"
android:text="@string/tv_rating"
android:textColor="@android:color/black"
android:textSize="18sp"
app:layout_constraintBottom_toBottomOf="@+id/ratingBar"
app:layout_constraintStart_toEndOf="@+id/ratingBar"
app:layout_constraintTop_toTopOf="@+id/ratingBar" />

<RatingBar
android:id="@+id/ratingBar"
style="@android:style/Widget.DeviceDefault.Light.RatingBar.Small"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="8dp"
android:layout_marginTop="10dp"
android:progressTint="#D35D44"
android:rating="4.5"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/view" />

<ImageView
android:id="@+id/imageView2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="10dp"
android:layout_marginEnd="8dp"
android:contentDescription="@null"
android:src="@drawable/ic_chat_black_24dp"
app:layout_constraintEnd_toStartOf="@+id/tv_comments"
app:layout_constraintTop_toBottomOf="@+id/view" />

<TextView
android:id="@+id/tv_comments"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="8dp"
android:layout_marginEnd="8dp"
android:fontFamily="@font/squada_one"
android:gravity="center"
android:text="@string/text_comment_number"
android:textColor="@android:color/black"
android:textSize="18sp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toBottomOf="@+id/view" />

<TextView
android:id="@+id/textView3"
android:layout_width="wrap_content"
android:layout_height="20dp"
android:layout_marginTop="8dp"
android:fontFamily="@font/fjalla_one"
android:text="@string/tv_movie_title"
android:textColor="@android:color/black"
android:textStyle="bold"
app:layout_constraintStart_toStartOf="@+id/ratingBar"
app:layout_constraintTop_toBottomOf="@+id/ratingBar" />

<TextView
android:id="@+id/tv_description"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="8dp"
android:layout_marginTop="8dp"
android:layout_marginEnd="8dp"
android:layout_marginBottom="2dp"
android:paddingBottom="4dp"
android:text="@string/text_description"
android:textColor="@android:color/black"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="@+id/textView3"
app:layout_constraintTop_toBottomOf="@+id/textView3" />


</androidx.constraintlayout.widget.ConstraintLayout>


</androidx.cardview.widget.CardView>

<androidx.recyclerview.widget.RecyclerView
android:id="@+id/recycler_view_episodes"
android:layout_width="0dp"
android:layout_height="0dp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/card_view_meta_data"
tools:listitem="@layout/item_episode_layout" />


</androidx.constraintlayout.motion.widget.MotionLayout>
36 changes: 36 additions & 0 deletions app/src/main/res/layout/activity_splash_screen.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.motion.widget.MotionLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/motion_layout_intro"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#1DA1F2"
app:layoutDescription="@xml/scene_intro"
app:showPaths="false"
tools:context=".SplashScreenActivity">

<ImageView
android:id="@+id/iv_logo"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="8dp"
android:layout_marginTop="8dp"
android:layout_marginEnd="8dp"
android:layout_marginBottom="8dp"
android:contentDescription="@null"
android:src="@drawable/ic_twitter_logo" />

<TextView
android:id="@+id/tv_text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="8dp"
android:layout_marginTop="8dp"
android:fontFamily="@font/squada_one"
android:text="@string/text_twitter"
android:textAppearance="@style/TextAppearance.MaterialComponents.Headline1"
android:textColor="@color/white"
android:textSize="56sp" />

</androidx.constraintlayout.motion.widget.MotionLayout>
Loading

0 comments on commit eca503e

Please sign in to comment.