Skip to content

added new link in menu and new guide #259

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

Merged
merged 1 commit into from
Dec 2, 2020
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
1 change: 1 addition & 0 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ android {
variant.buildConfigField "String", "API_URL", "\"" + getKey(variant.buildType.name, "apiUrl") + "\""
variant.buildConfigField "String", "GUIDE_URL", "\"" + getKey(variant.buildType.name, "guideUrl") + "\""
variant.buildConfigField "String", "SAFETY_URL", "\"" + getKey(variant.buildType.name, "safetyUrl") + "\""
variant.buildConfigField "String", "OBSERVER_FEEDBACK_URL", "\"" + getKey(variant.buildType.name, "observerFeedbackUrl") + "\""
variant.buildConfigField "String", "ORGANISATION_WEB_URL", "\"" + getKey(variant.buildType.name, "organisationWebUrl") + "\""
variant.buildConfigField "String", "SERVICE_CENTER_PHONE_NUMBER", "\"" + getKey(variant.buildType.name, "serviceCenterPhoneNumber") + "\""
variant.buildConfigField "String", "PREFERRED_LOCALE", "\"" + getKey(variant.buildType.name, "preferredLocale") + "\""
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ object Constants {
const val REMOTE_CONFIG_PRIVACY_POLICY_URL = "privacy_policy_url"
const val REMOTE_CONFIG_OBSERVER_GUIDE_URL = "observer_guide_url"
const val REMOTE_CONFIG_SAFETY_GUIDE_URL = "safety_guide_url"
const val REMOTE_CONFIG_OBSERVER_FEEDBACK_URL = "observer_feedback_url"
const val REMOTE_CONFIG_ROUND_START_TIMESTAMP = "round_start_time"

const val PUSH_NOTIFICATION_TITLE = "title"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ class MainActivity : BaseActivity<MainViewModel>() {

navView.setCheckedItem(R.id.nav_forms)
navView.menu.findItem(R.id.nav_safety).isVisible = viewModel.isSafetyItemVisible
navView.menu.findItem(R.id.nav_obs_feedback).isVisible = viewModel.isObserverFeedbackItemVisible

selectedItem = navView.checkedItem
selectedItem!!.title = getStyledSpannableString(selectedItem!!.title.toString(), BOLD)
Expand Down Expand Up @@ -95,6 +96,13 @@ class MainActivity : BaseActivity<MainViewModel>() {
}
true
}
R.id.nav_obs_feedback -> {
val result = browse(viewModel.observerFeedbackUrl, true)
if (!result) {
logW("No app to view ${viewModel.observerFeedbackUrl}")
}
true
}
R.id.nav_visited_stations -> {
showVisitedPollingStations()
true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,14 @@ class MainViewModel : BaseViewModel() {
BuildConfig.SAFETY_URL
)
}
internal val observerFeedbackUrl by lazy {
remoteConfig.getStringOrDefault(
Constants.REMOTE_CONFIG_OBSERVER_FEEDBACK_URL,
BuildConfig.OBSERVER_FEEDBACK_URL
)
}
internal val isSafetyItemVisible = safetyUrl.isNotBlank()
internal val isObserverFeedbackItemVisible = observerFeedbackUrl.isNotBlank()
private val onLogoutLiveData = SingleLiveEvent<Void>()

fun onLogoutLiveData(): SingleLiveEvent<Void> = onLogoutLiveData
Expand Down
5 changes: 5 additions & 0 deletions app/src/main/res/menu/main_menu.xml
Original file line number Diff line number Diff line change
Expand Up @@ -43,5 +43,10 @@
android:icon="@drawable/ic_menu_about"
android:title="@string/menu_settings" />

<item
android:id="@+id/nav_obs_feedback"
android:icon="@drawable/ic_menu_guide"
android:title="@string/menu_obs_feedback" />

</group>
</menu>
1 change: 1 addition & 0 deletions app/src/main/res/values-ro-rRO/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@
<string name="menu_change_polling_station">Schimbă secţia</string>
<string name="menu_guide">Ghidul observatorului</string>
<string name="menu_safety">Siguranța la vot</string>
<string name="menu_obs_feedback">Feedback observatori</string>
<string name="menu_call">Apelează TelVerde</string>
<string name="menu_about">Despre</string>
<string name="menu_logout">Delogare</string>
Expand Down
1 change: 1 addition & 0 deletions app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@
<string name="menu_change_polling_station">Change the polling station</string>
<string name="menu_guide">Observer\'s guide</string>
<string name="menu_safety">Voting safety</string>
<string name="menu_obs_feedback">Observers feedback</string>
<string name="menu_call">Call the Hotline</string>
<string name="menu_about">About</string>
<string name="menu_logout">Logout</string>
Expand Down
3 changes: 2 additions & 1 deletion debug.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
apiUrl=https://api.votemonitor.org/api/v1/
guideUrl=https://votcorect.ro/wp-content/uploads/2020/09/Manualul-observatorului-locale-2020-public.pdf
guideUrl=https://fiecarevot.ro/wp-content/uploads/2020/12/Manual-observatori-FV-parlamentare2020.pdf
safetyUrl=https://votromania.ro/siguranta-la-vot
observerFeedbackUrl=
organisationWebUrl=https://code4.ro/
serviceCenterPhoneNumber=0800080200
preferredLocale=ro_RO
Expand Down
3 changes: 2 additions & 1 deletion release.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
apiUrl=https://api.votemonitor.org/api/v1/
guideUrl=https://votcorect.ro/wp-content/uploads/2020/09/Manualul-observatorului-locale-2020-public.pdf
guideUrl=https://fiecarevot.ro/wp-content/uploads/2020/12/Manual-observatori-FV-parlamentare2020.pdf
safetyUrl=https://votromania.ro/siguranta-la-vot
observerFeedbackUrl=
organisationWebUrl=https://code4.ro/
serviceCenterPhoneNumber=0800080200
preferredLocale=ro_RO
Expand Down