Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
D
Dunbar
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
PLN
Dunbar
Commits
904b0fde
Unverified
Commit
904b0fde
authored
Nov 16, 2019
by
PLN (Algolia)
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
refactor: Renaming
parent
baee5a94
Show whitespace changes
Inline
Side-by-side
Showing
15 changed files
with
99 additions
and
117 deletions
+99
-117
AndroidManifest.xml
app/src/main/AndroidManifest.xml
+11
-7
FriendDetailActivity.kt
app/src/main/java/fr/plnech/dunbar/FriendDetailActivity.kt
+10
-30
FriendDetailFragment.kt
app/src/main/java/fr/plnech/dunbar/FriendDetailFragment.kt
+6
-6
FriendListActivity.kt
app/src/main/java/fr/plnech/dunbar/FriendListActivity.kt
+14
-14
Messages.kt
app/src/main/java/fr/plnech/dunbar/data/Messages.kt
+2
-1
Friend.kt
app/src/main/java/fr/plnech/dunbar/model/Friend.kt
+1
-1
FriendReminder.kt
app/src/main/java/fr/plnech/dunbar/notif/FriendReminder.kt
+3
-3
ContactsActivity.kt
app/src/main/java/fr/plnech/dunbar/ui/ContactsActivity.kt
+8
-8
FriendsAdapter.kt
app/src/main/java/fr/plnech/dunbar/ui/FriendsAdapter.kt
+25
-29
friend_list.xml
app/src/main/res/layout-w900dp/friend_list.xml
+7
-7
activity_friend_detail.xml
app/src/main/res/layout/activity_friend_detail.xml
+2
-2
friend_detail.xml
app/src/main/res/layout/friend_detail.xml
+1
-1
friend_list.xml
app/src/main/res/layout/friend_list.xml
+3
-3
menu_main.xml
app/src/main/res/menu/menu_main.xml
+2
-2
strings.xml
app/src/main/res/values/strings.xml
+4
-3
No files found.
app/src/main/AndroidManifest.xml
View file @
904b0fde
<?xml version="1.0" encoding="utf-8"?>
<manifest
xmlns:android=
"http://schemas.android.com/apk/res/android"
xmlns:tools=
"http://schemas.android.com/tools"
package=
"fr.plnech.dunbar"
>
<uses-permission
android:name=
"android.permission.READ_CONTACTS"
/>
...
...
@@ -12,10 +13,13 @@
android:label=
"@string/app_name"
android:roundIcon=
"@mipmap/ic_launcher_round"
android:supportsRtl=
"true"
android:theme=
"@style/AppTheme"
>
android:theme=
"@style/AppTheme"
tools:ignore=
"GoogleAppIndexingWarning"
>
<!-- TODO: https://developer.android.com/studio/write/app-link-indexing -->
<activity
android:name=
".
Buddy
ListActivity"
android:label=
"@string/title_
buddy
_list"
android:name=
".
Friend
ListActivity"
android:label=
"@string/title_
friend
_list"
android:parentActivityName=
".ui.FriendsActivity"
android:theme=
"@style/AppTheme.NoActionBar"
>
<meta-data
...
...
@@ -23,13 +27,13 @@
android:value=
"fr.plnech.dunbar.ui.FriendsActivity"
/>
</activity>
<activity
android:name=
".
Buddy
DetailActivity"
android:label=
"@string/title_
buddy
_detail"
android:parentActivityName=
".
Buddy
ListActivity"
android:name=
".
Friend
DetailActivity"
android:label=
"@string/title_
friend
_detail"
android:parentActivityName=
".
Friend
ListActivity"
android:theme=
"@style/AppTheme.NoActionBar"
>
<meta-data
android:name=
"android.support.PARENT_ACTIVITY"
android:value=
"fr.plnech.dunbar.
Buddy
ListActivity"
/>
android:value=
"fr.plnech.dunbar.
Friend
ListActivity"
/>
</activity>
<activity
android:name=
".ui.FriendsActivity"
...
...
app/src/main/java/fr/plnech/dunbar/FriendDetailActivity.kt
View file @
904b0fde
...
...
@@ -5,19 +5,19 @@ import android.os.Bundle
import
android.view.MenuItem
import
androidx.appcompat.app.AppCompatActivity
import
com.google.android.material.snackbar.Snackbar
import
kotlinx.android.synthetic.main.activity_
buddy
_detail.*
import
kotlinx.android.synthetic.main.activity_
friend
_detail.*
/**
* An activity representing a single Friend detail screen. This
* activity is only used on narrow width devices. On tablet-size devices,
* item details are presented side-by-side with a list of items
* in a [
Buddy
ListActivity].
* in a [
Friend
ListActivity].
*/
class
Buddy
DetailActivity
:
AppCompatActivity
()
{
class
Friend
DetailActivity
:
AppCompatActivity
()
{
override
fun
onCreate
(
savedInstanceState
:
Bundle
?)
{
super
.
onCreate
(
savedInstanceState
)
setContentView
(
R
.
layout
.
activity_
buddy
_detail
)
setContentView
(
R
.
layout
.
activity_
friend
_detail
)
setSupportActionBar
(
detail_toolbar
)
fab
.
setOnClickListener
{
view
->
...
...
@@ -25,32 +25,18 @@ class BuddyDetailActivity : AppCompatActivity() {
.
setAction
(
"Action"
,
null
).
show
()
}
// Show the Up button in the action bar.
supportActionBar
?.
setDisplayHomeAsUpEnabled
(
true
)
// savedInstanceState is non-null when there is fragment state
// saved from previous configurations of this activity
// (e.g. when rotating the screen from portrait to landscape).
// In this case, the fragment will automatically be re-added
// to its container so we don't need to manually add it.
// For more information, see the Fragments API guide at:
//
// http://developer.android.com/guide/components/fragments.html
//
if
(
savedInstanceState
==
null
)
{
// Create the detail fragment and add it to the activity
// using a fragment transaction.
val
fragment
=
BuddyDetailFragment
().
apply
{
supportFragmentManager
.
beginTransaction
()
.
add
(
R
.
id
.
friend_detail_container
,
FriendDetailFragment
().
apply
{
arguments
=
Bundle
().
apply
{
putString
(
Buddy
DetailFragment
.
ARG_ITEM_ID
,
intent
.
getStringExtra
(
Buddy
DetailFragment
.
ARG_ITEM_ID
)
Friend
DetailFragment
.
ARG_ITEM_ID
,
intent
.
getStringExtra
(
Friend
DetailFragment
.
ARG_ITEM_ID
)
)
}
}
supportFragmentManager
.
beginTransaction
()
.
add
(
R
.
id
.
buddy_detail_container
,
fragment
)
})
.
commit
()
}
}
...
...
@@ -58,13 +44,7 @@ class BuddyDetailActivity : AppCompatActivity() {
override
fun
onOptionsItemSelected
(
item
:
MenuItem
)
=
when
(
item
.
itemId
)
{
android
.
R
.
id
.
home
->
{
// This ID represents the Home or Up button. In the case of this
// activity, the Up button is shown. For
// more details, see the Navigation pattern on Android Design:
//
// http://developer.android.com/design/patterns/navigation.html#up-vs-back
navigateUpTo
(
Intent
(
this
,
BuddyListActivity
::
class
.
java
))
navigateUpTo
(
Intent
(
this
,
FriendListActivity
::
class
.
java
))
true
}
else
->
super
.
onOptionsItemSelected
(
item
)
...
...
app/src/main/java/fr/plnech/dunbar/FriendDetailFragment.kt
View file @
904b0fde
...
...
@@ -7,16 +7,16 @@ import android.view.ViewGroup
import
androidx.fragment.app.Fragment
import
fr.plnech.dunbar.dummy.DummyContent
import
fr.plnech.dunbar.model.Friend
import
kotlinx.android.synthetic.main.activity_
buddy
_detail.*
import
kotlinx.android.synthetic.main.
buddy
_detail.view.*
import
kotlinx.android.synthetic.main.activity_
friend
_detail.*
import
kotlinx.android.synthetic.main.
friend
_detail.view.*
/**
* A fragment representing a single
Buddy
detail screen.
* A fragment representing a single
Friend
detail screen.
* This fragment is either contained in a [FriendListActivity]
* in two-pane mode (on tablets) or a [FriendDetailActivity]
* on handsets.
*/
class
Buddy
DetailFragment
:
Fragment
()
{
class
Friend
DetailFragment
:
Fragment
()
{
/**
* The dummy content this fragment is presenting.
...
...
@@ -41,11 +41,11 @@ class BuddyDetailFragment : Fragment() {
inflater
:
LayoutInflater
,
container
:
ViewGroup
?,
savedInstanceState
:
Bundle
?
):
View
?
{
val
rootView
=
inflater
.
inflate
(
R
.
layout
.
buddy
_detail
,
container
,
false
)
val
rootView
=
inflater
.
inflate
(
R
.
layout
.
friend
_detail
,
container
,
false
)
// Show the dummy content as text in a TextView.
item
?.
let
{
rootView
.
buddy
_detail
.
text
=
it
.
mapString
()
rootView
.
friend
_detail
.
text
=
it
.
mapString
()
activity
?.
title
=
it
.
name
}
...
...
app/src/main/java/fr/plnech/dunbar/FriendListActivity.kt
View file @
904b0fde
...
...
@@ -13,11 +13,11 @@ import androidx.recyclerview.widget.RecyclerView
import
com.google.android.material.snackbar.Snackbar
import
fr.plnech.dunbar.dummy.DummyContent
import
fr.plnech.dunbar.model.Friend
import
kotlinx.android.synthetic.main.activity_
buddy
_list.*
import
kotlinx.android.synthetic.main.
buddy
_list.*
import
kotlinx.android.synthetic.main.
buddy
_list_content.view.*
import
kotlinx.android.synthetic.main.activity_
friends
_list.*
import
kotlinx.android.synthetic.main.
friend
_list.*
import
kotlinx.android.synthetic.main.
friend
_list_content.view.*
class
Buddy
ListActivity
:
AppCompatActivity
()
{
class
Friend
ListActivity
:
AppCompatActivity
()
{
/**
* Whether or not the activity is in two-pane mode, i.e. running on a tablet
...
...
@@ -27,7 +27,7 @@ class BuddyListActivity : AppCompatActivity() {
override
fun
onCreate
(
savedInstanceState
:
Bundle
?)
{
super
.
onCreate
(
savedInstanceState
)
setContentView
(
R
.
layout
.
activity_
buddy
_list
)
setContentView
(
R
.
layout
.
activity_
friends
_list
)
setSupportActionBar
(
toolbar
)
toolbar
.
title
=
title
...
...
@@ -39,7 +39,7 @@ class BuddyListActivity : AppCompatActivity() {
// Show the Up button in the action bar.
supportActionBar
?.
setDisplayHomeAsUpEnabled
(
true
)
if
(
buddy
_detail_container
!=
null
)
{
if
(
friend
_detail_container
!=
null
)
{
// The detail container view will be present only in the
// large-screen layouts (res/values-w900dp).
// If this view is present, then the
...
...
@@ -47,7 +47,7 @@ class BuddyListActivity : AppCompatActivity() {
twoPane
=
true
}
setupRecyclerView
(
buddy
_list
)
setupRecyclerView
(
friend
_list
)
}
override
fun
onOptionsItemSelected
(
item
:
MenuItem
)
=
...
...
@@ -64,7 +64,7 @@ class BuddyListActivity : AppCompatActivity() {
}
class
SimpleItemRecyclerViewAdapter
(
private
val
parentActivity
:
Buddy
ListActivity
,
private
val
parentActivity
:
Friend
ListActivity
,
private
val
values
:
List
<
Friend
>,
private
val
twoPane
:
Boolean
)
:
...
...
@@ -76,18 +76,18 @@ class BuddyListActivity : AppCompatActivity() {
onClickListener
=
View
.
OnClickListener
{
v
->
val
item
=
v
.
tag
as
Friend
if
(
twoPane
)
{
val
fragment
=
Buddy
DetailFragment
().
apply
{
val
fragment
=
Friend
DetailFragment
().
apply
{
arguments
=
Bundle
().
apply
{
putString
(
Buddy
DetailFragment
.
ARG_ITEM_ID
,
"friend_${item.id}"
)
putString
(
Friend
DetailFragment
.
ARG_ITEM_ID
,
"friend_${item.id}"
)
}
}
parentActivity
.
supportFragmentManager
.
beginTransaction
()
.
replace
(
R
.
id
.
buddy
_detail_container
,
fragment
)
.
replace
(
R
.
id
.
friend
_detail_container
,
fragment
)
.
commit
()
}
else
{
val
intent
=
Intent
(
v
.
context
,
Buddy
DetailActivity
::
class
.
java
).
apply
{
putExtra
(
Buddy
DetailFragment
.
ARG_ITEM_ID
,
"friend_${item.id}"
)
val
intent
=
Intent
(
v
.
context
,
Friend
DetailActivity
::
class
.
java
).
apply
{
putExtra
(
Friend
DetailFragment
.
ARG_ITEM_ID
,
"friend_${item.id}"
)
}
v
.
context
.
startActivity
(
intent
)
}
...
...
@@ -96,7 +96,7 @@ class BuddyListActivity : AppCompatActivity() {
override
fun
onCreateViewHolder
(
parent
:
ViewGroup
,
viewType
:
Int
):
ViewHolder
{
val
view
=
LayoutInflater
.
from
(
parent
.
context
)
.
inflate
(
R
.
layout
.
buddy
_list_content
,
parent
,
false
)
.
inflate
(
R
.
layout
.
friend
_list_content
,
parent
,
false
)
return
ViewHolder
(
view
)
}
...
...
app/src/main/java/fr/plnech/dunbar/data/Messages.kt
View file @
904b0fde
package
fr.plnech.dunbar.data
import
android.annotation.SuppressLint
import
android.content.Context
import
android.net.Uri
import
android.provider.Telephony
...
...
@@ -16,6 +17,7 @@ class Messages(context: Context) {
sent
=
fetchMessages
(
Telephony
.
Sms
.
Sent
.
CONTENT_URI
)
}
@SuppressLint
(
"Recycle"
)
// Cursor is recycled when nonnull
private
fun
fetchMessages
(
uri
:
Uri
):
MutableList
<
Map
<
String
,
String
?>>
{
val
messages
=
mutableListOf
<
Map
<
String
,
String
?>>()
...
...
@@ -41,7 +43,6 @@ class Messages(context: Context) {
}
else
{
println
(
"Null cursor."
)
}
}
return
messages
}
...
...
app/src/main/java/fr/plnech/dunbar/model/Friend.kt
View file @
904b0fde
...
...
@@ -18,7 +18,7 @@ data class Friend(val map: Map<String, String?> = mutableMapOf(), val photo: Bit
get
()
=
name
?.
split
(
Regex
(
"\\s"
))
?.
firstOrNull
()
val
id
:
Int
get
()
=
map
[
Contacts
.
_ID
]
!!
.
toInt
()
get
()
=
(
map
[
Contacts
.
_ID
]
?:
error
(
"No id for friend $name"
))
.
toInt
()
val
phone
:
String
?
get
()
=
if
(
map
[
Contacts
.
HAS_PHONE_NUMBER
]
==
"1"
)
map
[
"data1"
]
else
null
...
...
app/src/main/java/fr/plnech/dunbar/notif/FriendReminder.kt
View file @
904b0fde
...
...
@@ -7,11 +7,11 @@ import androidx.core.app.NotificationCompat
import
fr.plnech.dunbar.model.Friend
val
CHANNEL_ID
=
"dunbar"
const
val
CHANNEL_ID
=
"dunbar"
class
FriendReminder
(
val
ctx
:
Context
)
{
class
FriendReminder
(
private
val
ctx
:
Context
)
{
var
channelCreated
=
false
private
var
channelCreated
=
false
private
fun
createNotificationChannel
()
{
// Create the NotificationChannel, but only on API 26+ because
...
...
app/src/main/java/fr/plnech/dunbar/ui/ContactsActivity.kt
View file @
904b0fde
...
...
@@ -8,14 +8,14 @@ import android.widget.Toast
import
androidx.appcompat.app.AppCompatActivity
import
androidx.core.app.NotificationManagerCompat
import
androidx.recyclerview.widget.LinearLayoutManager
import
fr.plnech.dunbar.
Buddy
ListActivity
import
fr.plnech.dunbar.
Friend
ListActivity
import
fr.plnech.dunbar.R
import
fr.plnech.dunbar.data.Messages
import
fr.plnech.dunbar.fetchFriends
import
fr.plnech.dunbar.model.Friend
import
fr.plnech.dunbar.notif.FriendReminder
import
fr.plnech.dunbar.plural
import
kotlinx.android.synthetic.main.activity_
friend
s.*
import
kotlinx.android.synthetic.main.activity_
contact
s.*
import
kotlinx.android.synthetic.main.content_friends.*
import
java.util.*
...
...
@@ -27,7 +27,7 @@ class FriendsActivity : AppCompatActivity() {
override
fun
onCreate
(
savedInstanceState
:
Bundle
?)
{
super
.
onCreate
(
savedInstanceState
)
setContentView
(
R
.
layout
.
activity_
friend
s
)
setContentView
(
R
.
layout
.
activity_
contact
s
)
setSupportActionBar
(
toolbar
)
// messages = Messages(applicationContext)
...
...
@@ -42,7 +42,7 @@ class FriendsActivity : AppCompatActivity() {
}
private
fun
notifyFriend
()
{
val
idNotif
=
0
val
idNotif
ication
=
0
val
notRecentlyTalked
=
friends
.
filter
{
it
.
lastDate
!=
null
&&
(
Date
().
time
-
it
.
lastDate
!!
.
time
)
>
1
*
60
*
60
*
1000
}
...
...
@@ -58,7 +58,7 @@ class FriendsActivity : AppCompatActivity() {
this
@FriendsActivity
)
notification
?.
let
{
notify
(
idNotif
,
notification
)
notify
(
idNotif
ication
,
notification
)
}
}
}
...
...
@@ -76,8 +76,8 @@ class FriendsActivity : AppCompatActivity() {
// as you specify a parent activity in AndroidManifest.xml.
return
when
(
item
.
itemId
)
{
R
.
id
.
action_settings
->
true
R
.
id
.
action_
buddie
s
->
{
startActivity
(
Intent
(
this
,
Buddy
ListActivity
::
class
.
java
))
R
.
id
.
action_
friend
s
->
{
startActivity
(
Intent
(
this
,
Friend
ListActivity
::
class
.
java
))
true
}
else
->
super
.
onOptionsItemSelected
(
item
)
...
...
@@ -106,7 +106,7 @@ class FriendsActivity : AppCompatActivity() {
friendsList
.
layoutManager
=
LinearLayoutManager
(
this
)
friendsList
.
setHasFixedSize
(
true
)
friendsList
.
adapter
=
adapter
welcomeTitle
.
text
=
"$nbFriends ${"
friend
".plural(nbFriends)} on Dunbar"
welcomeTitle
.
text
=
getString
(
R
.
string
.
text_welcome
).
format
(
nbFriends
,
"friend"
.
plural
(
nbFriends
))
}
}
app/src/main/java/fr/plnech/dunbar/ui/FriendsAdapter.kt
View file @
904b0fde
...
...
@@ -17,11 +17,7 @@ class FriendsAdapter(
override
fun
onCreateViewHolder
(
parent
:
ViewGroup
,
viewType
:
Int
):
FriendsViewHolder
=
FriendsViewHolder
(
LayoutInflater
.
from
(
parent
.
context
).
inflate
(
viewType
,
parent
,
false
)
LayoutInflater
.
from
(
parent
.
context
).
inflate
(
viewType
,
parent
,
false
)
)
override
fun
getItemCount
():
Int
=
friends
.
size
...
...
@@ -43,35 +39,12 @@ class FriendsViewHolder(private val view: View) : RecyclerView.ViewHolder(view)
fun
bind
(
friend
:
Friend
)
{
name
.
text
=
friend
.
name
data
.
text
=
buildDataString
(
friend
)
bindPhone
(
friend
)
bindPhone
(
friend
)
bindPic
(
friend
)
bindClick
(
friend
)
}
private
fun
buildDataString
(
friend
:
Friend
):
String
{
return
buildString
{
if
(
friend
.
lastDate
!=
null
)
{
append
(
friend
.
timesContacted
)
append
(
" interactions, last "
)
append
(
DateUtils
.
getRelativeTimeSpanString
(
friend
.
lastTimeStamp
))
}
else
{
append
(
"Never interacted"
)
}
}
}
private
fun
bindClick
(
friend
:
Friend
)
{
view
.
setOnClickListener
{
Toast
.
makeText
(
view
.
context
,
friend
.
mapString
(),
Toast
.
LENGTH_LONG
).
show
()
println
(
friend
.
mapString
())
}
}
private
fun
bindPic
(
friend
:
Friend
)
{
pic
.
setImageBitmap
(
friend
.
photo
)
}
private
fun
bindPhone
(
friend
:
Friend
)
{
friend
.
phone
?.
let
{
phone
.
text
=
it
...
...
@@ -90,4 +63,27 @@ class FriendsViewHolder(private val view: View) : RecyclerView.ViewHolder(view)
}
}
private
fun
bindPic
(
friend
:
Friend
)
{
pic
.
setImageBitmap
(
friend
.
photo
)
}
private
fun
bindClick
(
friend
:
Friend
)
{
view
.
setOnClickListener
{
Toast
.
makeText
(
view
.
context
,
friend
.
mapString
(),
Toast
.
LENGTH_LONG
).
show
()
println
(
friend
.
mapString
())
}
}
private
fun
buildDataString
(
friend
:
Friend
):
String
{
return
buildString
{
if
(
friend
.
lastDate
!=
null
)
{
append
(
friend
.
timesContacted
)
append
(
" interactions, last "
)
append
(
DateUtils
.
getRelativeTimeSpanString
(
friend
.
lastTimeStamp
))
}
else
{
append
(
"Never interacted"
)
}
}
}
}
app/src/main/res/layout-w900dp/
buddy
_list.xml
→
app/src/main/res/layout-w900dp/
friend
_list.xml
View file @
904b0fde
...
...
@@ -10,28 +10,28 @@
android:divider=
"?android:attr/dividerHorizontal"
android:orientation=
"horizontal"
android:showDividers=
"middle"
tools:context=
".
Buddy
ListActivity"
>
tools:context=
".
Friend
ListActivity"
>
<!--
This layout is a two-pane layout for the
Buddie
s
This layout is a two-pane layout for the
Friend
s
master/detail flow.
-->
<androidx.recyclerview.widget.RecyclerView
xmlns:android=
"http://schemas.android.com/apk/res/android"
xmlns:tools=
"http://schemas.android.com/tools"
android:id=
"@+id/
buddy
_list"
android:name=
"fr.plnech.dunbar.
Buddy
ListFragment"
android:id=
"@+id/
friend
_list"
android:name=
"fr.plnech.dunbar.
Friend
ListFragment"
android:layout_width=
"@dimen/item_width"
android:layout_height=
"match_parent"
android:layout_marginLeft=
"16dp"
android:layout_marginRight=
"16dp"
app:layoutManager=
"LinearLayoutManager"
tools:context=
"fr.plnech.dunbar.
Buddy
ListActivity"
tools:listitem=
"@layout/
buddy
_list_content"
/>
tools:context=
"fr.plnech.dunbar.
Friend
ListActivity"
tools:listitem=
"@layout/
friend
_list_content"
/>
<FrameLayout
android:id=
"@+id/
buddy
_detail_container"
android:id=
"@+id/
friend
_detail_container"
android:layout_width=
"0dp"
android:layout_height=
"match_parent"
android:layout_weight=
"3"
/>
...
...
app/src/main/res/layout/activity_friend_detail.xml
View file @
904b0fde
...
...
@@ -36,7 +36,7 @@
</com.google.android.material.appbar.AppBarLayout>
<androidx.core.widget.NestedScrollView
android:id=
"@+id/
buddy
_detail_container"
android:id=
"@+id/
friend
_detail_container"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
app:layout_behavior=
"@string/appbar_scrolling_view_behavior"
/>
...
...
@@ -47,7 +47,7 @@
android:layout_height=
"wrap_content"
android:layout_gravity=
"center_vertical|start"
android:layout_margin=
"@dimen/fab_margin"
app:layout_anchor=
"@+id/
buddy
_detail_container"
app:layout_anchor=
"@+id/
friend
_detail_container"
app:layout_anchorGravity=
"top|end"
app:srcCompat=
"@android:drawable/stat_notify_chat"
/>
...
...
app/src/main/res/layout/friend_detail.xml
View file @
904b0fde
<?xml version="1.0" encoding="utf-8"?>
<TextView
xmlns:android=
"http://schemas.android.com/apk/res/android"
xmlns:tools=
"http://schemas.android.com/tools"
android:id=
"@+id/
buddy
_detail"
android:id=
"@+id/
friend
_detail"
style=
"?android:attr/textAppearanceLarge"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
...
...
app/src/main/res/layout/friend_list.xml
View file @
904b0fde
...
...
@@ -15,7 +15,7 @@
android:layout_marginTop=
"8dp"
android:layout_marginBottom=
"8dp"
android:textSize=
"24sp"
app:layout_constraintBottom_toTopOf=
"@id/
buddy
_list"
app:layout_constraintBottom_toTopOf=
"@id/
friend
_list"
app:layout_constraintLeft_toLeftOf=
"parent"
app:layout_constraintRight_toRightOf=
"parent"
app:layout_constraintTop_toTopOf=
"parent"
...
...
@@ -23,8 +23,8 @@
tools:text=
"N friends on Dunbar"
/>
<androidx.recyclerview.widget.RecyclerView
android:id=
"@+id/
buddy
_list"
android:name=
"fr.plnech.dunbar.
Buddy
ListFragment"
android:id=
"@+id/
friend
_list"
android:name=
"fr.plnech.dunbar.
Friend
ListFragment"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
android:layout_marginLeft=
"16dp"
...
...
app/src/main/res/menu/menu_main.xml
View file @
904b0fde
...
...
@@ -3,9 +3,9 @@
xmlns:tools=
"http://schemas.android.com/tools"
tools:context=
"fr.plnech.dunbar.ui.FriendsActivity"
>
<item
android:id=
"@+id/action_
buddie
s"
android:id=
"@+id/action_
friend
s"
android:orderInCategory=
"100"
android:title=
"@string/action_
buddie
s"
android:title=
"@string/action_
friend
s"
app:showAsAction=
"ifRoom"
/>
<item
android:id=
"@+id/action_settings"
...
...
app/src/main/res/values/strings.xml
View file @
904b0fde
...
...
@@ -3,7 +3,8 @@
<string
name=
"channel_name"
>
Dunbar
</string>
<string
name=
"channel_description"
>
Updates about friends you don\'t want to forget
</string>
<string
name=
"action_settings"
>
Settings
</string>
<string
name=
"action_buddies"
>
Buddies
</string>
<string
name=
"title_buddy_list"
>
Buddies
</string>
<string
name=
"title_buddy_detail"
>
Buddy Detail
</string>
<string
name=
"action_friends"
>
Friends
</string>
<string
name=
"title_friend_list"
>
Friends
</string>
<string
name=
"title_friend_detail"
>
Friend Detail
</string>
<string
name=
"text_welcome"
>
"%1$d %2$s on Dunbar"
</string>
</resources>
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment