-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
簡単入門画面の作成 #40
Merged
Merged
簡単入門画面の作成 #40
Changes from all commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
8d034f9
Merge branch 'feature-21' of https://github.com/kirikirisu/kanazawaAp…
kirikirisu b971494
Merge branch 'master' of https://github.com/kirikirisu/kanazawaApp-2019
kirikirisu 50783c4
Merge branch 'master' of https://github.com/kirikirisu/kanazawaApp-2019
kirikirisu f98ebb3
入門画面の初期画面追加
kirikirisu b42e8b1
保存食追加画面への遷移
kirikirisu 7700d9a
リスト見方画面の追加
kirikirisu be1f6ac
一覧画面の見方追加
kirikirisu 62929ea
通知設定の仕方画面の追加
kirikirisu 03df0c8
避難所の見方画面の追加
kirikirisu 418aa72
Merge branch 'master' of https://github.com/kirikirisu/kanazawaApp-20…
kirikirisu e7eeb72
コンフリクト解消
kirikirisu File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
64 changes: 64 additions & 0 deletions
64
app/src/main/java/com/example/kanazawaapp_2019/GettingStartMainActivity.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
package com.example.kanazawaapp_2019 | ||
|
||
import android.content.Intent | ||
import android.location.LocationManager | ||
import android.os.Bundle | ||
import android.util.Log | ||
import android.widget.ArrayAdapter | ||
import android.widget.ListView | ||
import androidx.appcompat.app.AppCompatActivity | ||
import androidx.core.content.ContextCompat | ||
|
||
class GettingStartMainActivity: AppCompatActivity() { | ||
|
||
lateinit var finalyIntent: Intent | ||
|
||
override fun onCreate(savedInstanceState: Bundle?) { | ||
super.onCreate(savedInstanceState) | ||
setContentView(R.layout.activity_getting_start_main) | ||
|
||
setUpToolbar() | ||
|
||
renderList() | ||
} | ||
|
||
fun setUpToolbar() { | ||
setSupportActionBar(findViewById(R.id.toolbar)) | ||
window.statusBarColor = ContextCompat.getColor(this, R.color.colorPrimaryDark) | ||
supportActionBar?.let { | ||
it.setDisplayHomeAsUpEnabled(true) | ||
it.setHomeButtonEnabled(true) | ||
} ?: IllegalAccessError("toolbar cannot be null") | ||
} | ||
|
||
fun renderList() { | ||
val listView = findViewById(R.id.listView) as ListView | ||
val dataArray = arrayOf("保存食追加の仕方", "リストの見方", "一覧の見方", "通知設定の仕方", "避難所の見方") | ||
val adapter = ArrayAdapter<String>(this, android.R.layout.simple_list_item_1, dataArray) | ||
listView.adapter = adapter | ||
listView.setOnItemClickListener { parent, view, position, id -> | ||
// Log.i("debug", position.toString()) | ||
when (position) { | ||
0 -> { | ||
Log.i("debug", "保存食追加の仕方") | ||
finalyIntent = Intent(this, HowToAddFoodActivity::class.java) | ||
} | ||
1 -> { | ||
Log.i("debug", "リストの見方") | ||
finalyIntent = Intent(this, HowToLookListActivity::class.java) | ||
} | ||
2 -> { | ||
Log.i("debug", "一覧の見方") | ||
finalyIntent = Intent(this, HowToLookFirstScreenActivity::class.java) | ||
} | ||
3 -> { | ||
finalyIntent = Intent(this, HowToNotificationSettingsActivity::class.java) | ||
} | ||
4 -> { | ||
finalyIntent = Intent(this, HowToLookShelterActivity::class.java) | ||
} | ||
} | ||
startActivity(finalyIntent) | ||
} | ||
} | ||
} |
35 changes: 35 additions & 0 deletions
35
app/src/main/java/com/example/kanazawaapp_2019/HowToAddFoodActivity.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
package com.example.kanazawaapp_2019 | ||
|
||
import androidx.appcompat.app.AppCompatActivity | ||
import android.os.Bundle | ||
import android.view.MenuItem | ||
import androidx.core.content.ContextCompat | ||
|
||
class HowToAddFoodActivity : AppCompatActivity() { | ||
|
||
override fun onCreate(savedInstanceState: Bundle?) { | ||
super.onCreate(savedInstanceState) | ||
setContentView(R.layout.activity_how_to_add_food) | ||
|
||
setUpToolbar() | ||
} | ||
|
||
fun setUpToolbar() { | ||
setSupportActionBar(findViewById(R.id.toolbar)) | ||
window.statusBarColor = ContextCompat.getColor(this, R.color.colorPrimaryDark) | ||
supportActionBar?.let { | ||
it.setDisplayHomeAsUpEnabled(true) | ||
it.setHomeButtonEnabled(true) | ||
} ?: IllegalAccessError("toolbar cannot be null") | ||
} | ||
|
||
override fun onOptionsItemSelected(item: MenuItem): Boolean { | ||
when(item!!.itemId) { | ||
android.R.id.home -> { | ||
finish() | ||
} | ||
} | ||
|
||
return super.onOptionsItemSelected(item) | ||
} | ||
} |
35 changes: 35 additions & 0 deletions
35
app/src/main/java/com/example/kanazawaapp_2019/HowToLookFirstScreenActivity.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
package com.example.kanazawaapp_2019 | ||
|
||
import androidx.appcompat.app.AppCompatActivity | ||
import android.os.Bundle | ||
import android.view.MenuItem | ||
import androidx.core.content.ContextCompat | ||
|
||
class HowToLookFirstScreenActivity : AppCompatActivity() { | ||
|
||
override fun onCreate(savedInstanceState: Bundle?) { | ||
super.onCreate(savedInstanceState) | ||
setContentView(R.layout.activity_how_to_look_first_screen) | ||
|
||
setUpToolbar() | ||
} | ||
|
||
fun setUpToolbar() { | ||
setSupportActionBar(findViewById(R.id.toolbar)) | ||
window.statusBarColor = ContextCompat.getColor(this, R.color.colorPrimaryDark) | ||
supportActionBar?.let { | ||
it.setDisplayHomeAsUpEnabled(true) | ||
it.setHomeButtonEnabled(true) | ||
} ?: IllegalAccessError("toolbar cannot be null") | ||
} | ||
|
||
override fun onOptionsItemSelected(item: MenuItem): Boolean { | ||
when(item!!.itemId) { | ||
android.R.id.home -> { | ||
finish() | ||
} | ||
} | ||
|
||
return super.onOptionsItemSelected(item) | ||
} | ||
} |
35 changes: 35 additions & 0 deletions
35
app/src/main/java/com/example/kanazawaapp_2019/HowToLookListActivity.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
package com.example.kanazawaapp_2019 | ||
|
||
import androidx.appcompat.app.AppCompatActivity | ||
import android.os.Bundle | ||
import android.view.MenuItem | ||
import androidx.core.content.ContextCompat | ||
|
||
class HowToLookListActivity : AppCompatActivity() { | ||
|
||
override fun onCreate(savedInstanceState: Bundle?) { | ||
super.onCreate(savedInstanceState) | ||
setContentView(R.layout.activity_how_to_look_list) | ||
|
||
setUpToolbar() | ||
} | ||
|
||
fun setUpToolbar() { | ||
setSupportActionBar(findViewById(R.id.toolbar)) | ||
window.statusBarColor = ContextCompat.getColor(this, R.color.colorPrimaryDark) | ||
supportActionBar?.let { | ||
it.setDisplayHomeAsUpEnabled(true) | ||
it.setHomeButtonEnabled(true) | ||
} ?: IllegalAccessError("toolbar cannot be null") | ||
} | ||
|
||
override fun onOptionsItemSelected(item: MenuItem): Boolean { | ||
when(item!!.itemId) { | ||
android.R.id.home -> { | ||
finish() | ||
} | ||
} | ||
|
||
return super.onOptionsItemSelected(item) | ||
} | ||
} |
35 changes: 35 additions & 0 deletions
35
app/src/main/java/com/example/kanazawaapp_2019/HowToLookShelterActivity.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
package com.example.kanazawaapp_2019 | ||
|
||
import androidx.appcompat.app.AppCompatActivity | ||
import android.os.Bundle | ||
import android.view.MenuItem | ||
import androidx.core.content.ContextCompat | ||
|
||
class HowToLookShelterActivity : AppCompatActivity() { | ||
|
||
override fun onCreate(savedInstanceState: Bundle?) { | ||
super.onCreate(savedInstanceState) | ||
setContentView(R.layout.activity_how_to_look_shelter) | ||
|
||
setUpToolbar() | ||
} | ||
|
||
fun setUpToolbar() { | ||
setSupportActionBar(findViewById(R.id.toolbar)) | ||
window.statusBarColor = ContextCompat.getColor(this, R.color.colorPrimaryDark) | ||
supportActionBar?.let { | ||
it.setDisplayHomeAsUpEnabled(true) | ||
it.setHomeButtonEnabled(true) | ||
} ?: IllegalAccessError("toolbar cannot be null") | ||
} | ||
|
||
override fun onOptionsItemSelected(item: MenuItem): Boolean { | ||
when(item!!.itemId) { | ||
android.R.id.home -> { | ||
finish() | ||
} | ||
} | ||
|
||
return super.onOptionsItemSelected(item) | ||
} | ||
} |
35 changes: 35 additions & 0 deletions
35
app/src/main/java/com/example/kanazawaapp_2019/HowToNotificationSettingsActivity.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
package com.example.kanazawaapp_2019 | ||
|
||
import androidx.appcompat.app.AppCompatActivity | ||
import android.os.Bundle | ||
import android.view.MenuItem | ||
import androidx.core.content.ContextCompat | ||
|
||
class HowToNotificationSettingsActivity : AppCompatActivity() { | ||
|
||
override fun onCreate(savedInstanceState: Bundle?) { | ||
super.onCreate(savedInstanceState) | ||
setContentView(R.layout.activity_how_to_notification_settings) | ||
|
||
setUpToolbar() | ||
} | ||
|
||
fun setUpToolbar() { | ||
setSupportActionBar(findViewById(R.id.toolbar)) | ||
window.statusBarColor = ContextCompat.getColor(this, R.color.colorPrimaryDark) | ||
supportActionBar?.let { | ||
it.setDisplayHomeAsUpEnabled(true) | ||
it.setHomeButtonEnabled(true) | ||
} ?: IllegalAccessError("toolbar cannot be null") | ||
} | ||
|
||
override fun onOptionsItemSelected(item: MenuItem): Boolean { | ||
when(item!!.itemId) { | ||
android.R.id.home -> { | ||
finish() | ||
} | ||
} | ||
|
||
return super.onOptionsItemSelected(item) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" | ||
android:layout_width="match_parent" | ||
android:layout_height="match_parent" | ||
xmlns:app="http://schemas.android.com/apk/res-auto" | ||
android:orientation="vertical" | ||
android:fitsSystemWindows="true"> | ||
|
||
<androidx.appcompat.widget.Toolbar | ||
android:id="@+id/toolbar" | ||
android:minHeight="?attr/actionBarSize" | ||
android:layout_width="match_parent" | ||
android:layout_height="wrap_content" | ||
android:background="@color/colorPrimary" | ||
app:titleTextColor="@color/colorWhite" | ||
app:title="@string/gettingStartMainHeader"/> | ||
|
||
<ListView | ||
android:id="@+id/listView" | ||
android:layout_width="match_parent" | ||
android:layout_height="match_parent"/> | ||
|
||
|
||
</LinearLayout> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" | ||
android:layout_width="match_parent" | ||
android:layout_height="match_parent" | ||
xmlns:app="http://schemas.android.com/apk/res-auto" | ||
android:orientation="vertical" | ||
android:fitsSystemWindows="true"> | ||
|
||
<androidx.appcompat.widget.Toolbar | ||
android:id="@+id/toolbar" | ||
android:minHeight="?attr/actionBarSize" | ||
android:layout_width="match_parent" | ||
android:layout_height="wrap_content" | ||
android:background="@color/colorPrimary" | ||
app:titleTextColor="@color/colorWhite" | ||
app:title="@string/howToAddFoodHeader"/> | ||
|
||
<TextView | ||
android:layout_width="match_parent" | ||
android:layout_height="match_parent" | ||
android:gravity="center" | ||
android:text="保存食追加画面"/> | ||
|
||
</LinearLayout> |
24 changes: 24 additions & 0 deletions
24
app/src/main/res/layout/activity_how_to_look_first_screen.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" | ||
android:layout_width="match_parent" | ||
android:layout_height="match_parent" | ||
xmlns:app="http://schemas.android.com/apk/res-auto" | ||
android:orientation="vertical" | ||
android:fitsSystemWindows="true"> | ||
|
||
<androidx.appcompat.widget.Toolbar | ||
android:id="@+id/toolbar" | ||
android:minHeight="?attr/actionBarSize" | ||
android:layout_width="match_parent" | ||
android:layout_height="wrap_content" | ||
android:background="@color/colorPrimary" | ||
app:titleTextColor="@color/colorWhite" | ||
app:title="@string/howToLookFirstScreenHeader"/> | ||
|
||
<TextView | ||
android:layout_width="match_parent" | ||
android:layout_height="match_parent" | ||
android:gravity="center" | ||
android:text="一覧の見方画面"/> | ||
|
||
</LinearLayout> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" | ||
android:layout_width="match_parent" | ||
android:layout_height="match_parent" | ||
xmlns:app="http://schemas.android.com/apk/res-auto" | ||
android:orientation="vertical" | ||
android:fitsSystemWindows="true"> | ||
|
||
<androidx.appcompat.widget.Toolbar | ||
android:id="@+id/toolbar" | ||
android:minHeight="?attr/actionBarSize" | ||
android:layout_width="match_parent" | ||
android:layout_height="wrap_content" | ||
android:background="@color/colorPrimary" | ||
app:titleTextColor="@color/colorWhite" | ||
app:title="@string/howToLookListHeader"/> | ||
|
||
<TextView | ||
android:layout_width="match_parent" | ||
android:layout_height="match_parent" | ||
android:gravity="center" | ||
android:text="リストの見方画面"/> | ||
|
||
</LinearLayout> |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
良さげ