Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 15 additions & 6 deletions app/res/layout/nav_drawer_base.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
<LinearLayout android:layout_width="@dimen/nav_drawer_width"
android:layout_height="match_parent"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:orientation="vertical"
android:background="@color/cc_brand_color"
android:layout_gravity="start"
Expand Down Expand Up @@ -28,29 +29,37 @@
android:visibility="gone"
android:paddingTop="92dp"
android:layout_weight="1">

<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:src="@drawable/nav_drawer_logged_out_avatar"/>

<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:focusable="true"
android:layout_gravity="center"
android:textAlignment="center"
android:paddingTop="16dp"
android:paddingVertical="16dp"
android:clickable="true"
android:textAppearance="@style/TextAppearance.NavDrawerItem"
android:text="@string/nav_drawer_not_signed_in_to_personal_id"/>
<TextView
android:id="@+id/nav_drawer_sign_in_text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"

<com.google.android.material.button.MaterialButton
android:backgroundTint="@color/palatinate_blue"
android:id="@+id/nav_drawer_sign_in_button"
android:layout_gravity="center"
android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:paddingEnd="24dp"
android:paddingStart="24dp"
android:paddingTop="16dp"
android:text="@string/nav_drawer_signin_register"
android:textAppearance="@style/TextAppearance.NavDrawerItem"/>
android:textAppearance="@style/TextAppearance.NavDrawerItem"
app:icon="@drawable/connect_right_arrow"
app:iconGravity="end" />
</LinearLayout>

<androidx.recyclerview.widget.RecyclerView
Expand Down
2 changes: 1 addition & 1 deletion app/res/layout/screen_form_entry.xml
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@id/nav_badge"
android:background="@color/barcode_button_color"
android:background="@color/palatinate_blue"
android:minHeight="@dimen/new_progressbar_minheight"
android:paddingLeft="@dimen/content_start"
android:paddingRight="@dimen/content_start"
Expand Down
4 changes: 2 additions & 2 deletions app/res/layout/select_install_mode_fragment.xml
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@
android:id="@+id/btn_fetch_uri"
android:layout_width="wrap_content"
android:layout_height="match_parent"
SquareButtonWithText:backgroundColor="@color/barcode_button_color"
SquareButtonWithText:backgroundColor="@color/palatinate_blue"
SquareButtonWithText:img="@drawable/startup_barcode"
SquareButtonWithText:subtitle="Scan Application Barcode"
SquareButtonWithText:textColor="@color/white"/>
Expand All @@ -123,7 +123,7 @@
android:layout_height="match_parent"
android:background="@drawable/tile_drop_shadow_small_margins"
android:gravity="end"
SquareButtonWithText:backgroundColor="@color/barcode_button_color"
SquareButtonWithText:backgroundColor="@color/palatinate_blue"
SquareButtonWithText:img="@drawable/startup_url"
SquareButtonWithText:subtitle="Enter Code"
SquareButtonWithText:textColor="@color/white"/>
Expand Down
2 changes: 1 addition & 1 deletion app/res/values/colors.xml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
<color name="translucent_grey">#80D3D3D3</color>
<color name="translucent_grey_light">#A0D3D3D3</color>
<color name="blue">#3867AD</color>
<color name="palatinate_blue">#3843D0</color>
<color name="blue_grey">#6884AD</color>
<color name="blue_light">#7FA1D4</color>
<color name="translucent_blue">#903867AD</color>
Expand Down Expand Up @@ -155,7 +156,6 @@
<color name="start_sync_button">@color/cc_brand_color</color>
<color name="start_sync_dark_button">#3b4fb6</color>
<color name="start_logout_button">#373534</color>
<color name="barcode_button_color">#3843D0</color>
<color name="url_button_color">#8EA1FF</color>
<color name="square_button_icon_color">#FFFFFF</color>

Expand Down
2 changes: 1 addition & 1 deletion app/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -656,7 +656,7 @@
<string name="personalid_work_history_sync">Sync</string>

<string name="commcarehq_worker">CommCareHQ Worker</string>
<string name="nav_drawer_signin_register">Sign in / Register</string>
<string name="nav_drawer_signin_register">Sign In / Register</string>
<string name="nav_drawer_help">Help</string>
<string name="nav_drawer_not_signed_in_to_personal_id">You are not signed in to Personal ID</string>
<string name="nav_drawer_opportunities">Opportunities</string>
Expand Down
22 changes: 13 additions & 9 deletions app/src/org/commcare/navdrawer/BaseDrawerController.kt
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
package org.commcare.navdrawer
import android.text.SpannableString
import android.text.style.UnderlineSpan

import android.view.MenuItem
import android.view.View
import androidx.appcompat.app.ActionBarDrawerToggle
Expand Down Expand Up @@ -90,9 +89,6 @@ class BaseDrawerController(
}

private fun setupViews() {
val content = SpannableString(activity.getString(R.string.nav_drawer_signin_register))
content.setSpan(UnderlineSpan(), 0, content.length, 0)
binding.signInText.text = content
binding.versionText.text = "v ${BuildConfig.VERSION_NAME}"
}

Expand All @@ -114,12 +110,19 @@ class BaseDrawerController(
}

private fun setupListeners() {
binding.signInText.setOnClickListener {
binding.signInButton.setOnClickListener {
PersonalIdManager.getInstance()
.launchPersonalId(activity, ConnectConstants.LOGIN_CONNECT_LAUNCH_REQUEST_CODE)
.launchPersonalId(
activity,
ConnectConstants.LOGIN_CONNECT_LAUNCH_REQUEST_CODE
)
closeDrawer()
}
binding.aboutView.setOnClickListener { DialogCreationHelpers.showAboutCommCareDialog(activity) }
binding.aboutView.setOnClickListener {
DialogCreationHelpers.showAboutCommCareDialog(
activity
)
}
binding.notificationView.setOnClickListener {
ConnectNavHelper.goToNotification(activity)
closeDrawer()
Expand Down Expand Up @@ -230,7 +233,8 @@ class BaseDrawerController(
binding.signoutView.visibility = if (isSignedIn) View.GONE else View.VISIBLE
binding.navDrawerRecycler.visibility = if (isSignedIn) View.VISIBLE else View.GONE
binding.profileCard.visibility = if (isSignedIn) View.VISIBLE else View.GONE
binding.notificationView.visibility = if (shouldShowNotiifcations()) View.VISIBLE else View.GONE
binding.notificationView.visibility =
if (shouldShowNotiifcations()) View.VISIBLE else View.GONE
}

private fun shouldShowWorkHistory(): Boolean {
Expand Down
3 changes: 2 additions & 1 deletion app/src/org/commcare/navdrawer/DrawerViewRefs.kt
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package org.commcare.navdrawer

import android.view.View
import android.widget.Button
import android.widget.FrameLayout
import android.widget.ImageView
import android.widget.LinearLayout
Expand All @@ -14,7 +15,7 @@ class DrawerViewRefs(rootView: View) {
val drawerLayout: DrawerLayout = rootView.findViewById(R.id.drawer_layout)
val navDrawerRecycler: RecyclerView = rootView.findViewById(R.id.nav_drawer_recycler)
val drawerFrame: FrameLayout = rootView.findViewById(R.id.nav_drawer_frame)
val signInText: TextView = rootView.findViewById(R.id.nav_drawer_sign_in_text)
val signInButton: Button = rootView.findViewById(R.id.nav_drawer_sign_in_button)
val versionText: TextView = rootView.findViewById(R.id.app_version)
val signoutView: LinearLayout = rootView.findViewById(R.id.signout_view)
val profileCard: CardView = rootView.findViewById(R.id.profile_card)
Expand Down
Loading