update with the splash fragment

This commit is contained in:
Keith Abdulla 2019-01-21 16:28:05 -08:00
parent e2dccb8491
commit 0c1b821d72
12 changed files with 77 additions and 18 deletions

1
.gitignore vendored
View File

@ -1 +1,2 @@
.idea/
.gradle/

View File

@ -116,26 +116,39 @@
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/annotation_processor_list" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/apk_list" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/blame" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/build-info" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/builds" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/bundle_manifest" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/check_manifest_result" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/compatible_screen_manifest" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/dex" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/incremental" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/incremental-runtime-classes" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/incremental-verifier" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/instant-run-apk" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/instant_app_manifest" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/instant_run_app_info_output_file" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/instant_run_main_apk_resources" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/instant_run_merged_manifests" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/instant_run_split_apk_resources" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/javac" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/jniLibs" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/lint_jar" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/manifest-checker" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/merged_assets" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/merged_manifests" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/metadata_application_id" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/metadata_feature_manifest" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/prebuild" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/processed_res" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/reload-dex" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/res" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/resources" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/rs" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/shader_assets" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/shaders" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/signing_config" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/split-apk" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/symbols" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/transforms" />
<excludeFolder url="file://$MODULE_DIR$/build/kotlin" />

View File

@ -1,16 +1,20 @@
package abdulla.com.hashtagit
import android.content.pm.ActivityInfo
import androidx.appcompat.app.AppCompatActivity
import android.os.Bundle
import android.view.Menu
class HashTagItActivity : AppCompatActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_hash_tag_it)
}
override fun onCreateOptionsMenu(menu: Menu?): Boolean {
super.onCreateOptionsMenu(menu)
menuInflater.inflate(R.menu.menu_main, menu)
return true
}
override fun onResume() {

View File

@ -2,28 +2,37 @@ package abdulla.com.hashtagit
import android.content.pm.ActivityInfo
import android.os.Bundle
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import android.view.*
import androidx.fragment.app.Fragment
import androidx.navigation.fragment.findNavController
import kotlinx.android.synthetic.main.splash_fragment.*
import kotlinx.android.synthetic.main.fragment_input.*
class InputFragment: Fragment() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
findNavController().navigate(InputFragmentDirections.actionInputFragmentToSplashFragment())
}
override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View? {
return inflater.inflate(R.layout.splash_fragment, container, false)
return inflater.inflate(R.layout.fragment_input, container, false)
}
override fun onStart() {
super.onStart()
button.setOnClickListener {
val directions = InputFragmentDirections.actionSplashFragmentToSubmissionFragment()
val directions = InputFragmentDirections.actionInputFragmentToSubmissionFragment()
directions.writtenText = mEditText.text.toString()
findNavController().navigate(directions)
}
}
override fun onCreateOptionsMenu(menu: Menu, inflater: MenuInflater) {
super.onCreateOptionsMenu(menu, inflater)
}
override fun onResume() {
super.onResume()

View File

@ -0,0 +1,7 @@
package abdulla.com.hashtagit
import androidx.fragment.app.Fragment
class SplashFragment: Fragment() {
}

View File

@ -10,10 +10,9 @@ import android.util.Log
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import android.view.Window
import android.widget.TextView
import androidx.fragment.app.Fragment
import kotlinx.android.synthetic.main.submission_fragment.*
import kotlinx.android.synthetic.main.fragment_submission.*
class SubmissionFragment : Fragment() {
@ -26,7 +25,7 @@ class SubmissionFragment : Fragment() {
// so need to make check with orientation
override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View? {
return inflater.inflate(R.layout.submission_fragment, container, false)
return inflater.inflate(R.layout.fragment_submission, container, false)
}
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {

View File

@ -1,5 +1,6 @@
<vector android:height="48dp" android:viewportHeight="48"
android:viewportWidth="48" android:width="48dp" xmlns:android="http://schemas.android.com/apk/res/android">
android:viewportWidth="48" android:width="48dp"
xmlns:android="http://schemas.android.com/apk/res/android">
<path android:fillAlpha=".36" android:fillColor="#FF000000" android:pathData="M0,20h24v4H0z"/>
<path android:fillColor="#FF000000" android:pathData="M11,3L5.5,17h2.25l1.12,-3h6.25l1.12,3h2.25L13,3h-2zM9.62,12L12,5.67 14.38,12L9.62,12z"/>
</vector>

View File

@ -0,0 +1,16 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout 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:layout_width="match_parent"
android:layout_height="match_parent">
<TextView
android:text="SPLLLASH!"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/textView2" app:layout_constraintStart_toStartOf="parent"
android:layout_marginStart="8dp" app:layout_constraintBottom_toBottomOf="parent"
android:layout_marginBottom="8dp" app:layout_constraintEnd_toEndOf="parent"
android:layout_marginEnd="8dp" android:layout_marginTop="8dp"
app:layout_constraintTop_toTopOf="parent"/>
</androidx.constraintlayout.widget.ConstraintLayout>

View File

@ -1,7 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<menu xmlns:android="http://schemas.android.com/apk/res/android">
<item android:id="@+id/icon_inverse"
<menu xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto">
<item android:id="e@+id/icon_inverse"
android:icon="@drawable/icon_text"
android:title="inverse"
app:showAsAction="always"
></item>
</menu>

View File

@ -1,15 +1,17 @@
<?xml version="1.0" encoding="utf-8"?>
<navigation xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/mobile_navigation" app:startDestination="@id/splashFragment">
android:id="@+id/mobile_navigation" app:startDestination="@id/inputFragment">
<fragment android:id="@+id/splashFragment"
<fragment android:id="@+id/inputFragment"
android:name="abdulla.com.hashtagit.InputFragment"
android:label="SplashFragment">
android:label="InputFragment">
<action android:id="@+id/action_splashFragment_to_submissionFragment"
<action android:id="@+id/action_inputFragment_to_submissionFragment"
app:destination="@id/submissionFragment">
</action>
<action android:id="@+id/action_inputFragment_to_splashFragment"
app:destination="@id/splashFragment"/>
</fragment>
<fragment android:id="@+id/submissionFragment"
@ -21,4 +23,10 @@
android:defaultValue="May-Ling"/>
</fragment>
<fragment android:id="@+id/splashFragment"
android:name="abdulla.com.hashtagit.SplashFragment"
android:label="SplashFragment">
<action android:id="@+id/action_splashFragment_to_inputFragment"
app:destination="@id/inputFragment"/>
</fragment>
</navigation>