Skip to content

Commit dfec474

Browse files
Merge pull request #239 from nextcloud/participate
Motivate more users
2 parents 0bec9c3 + 07f5d95 commit dfec474

File tree

14 files changed

+335
-11
lines changed

14 files changed

+335
-11
lines changed

AndroidManifest.xml

+1
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,7 @@
7373
</intent-filter>
7474
</activity>
7575
<activity android:name=".ui.activity.ManageAccountsActivity" />
76+
<activity android:name=".ui.activity.ParticipateActivity" />
7677
<activity android:name=".ui.activity.UploadFilesActivity" />
7778
<activity android:name=".ui.activity.ReceiveExternalFilesActivity"
7879
android:taskAffinity=""

res/drawable-hdpi/ic_participate.png

754 Bytes
Loading

res/drawable-mdpi/ic_participate.png

535 Bytes
Loading

res/drawable-xhdpi/ic_participate.png

910 Bytes
Loading
1.31 KB
Loading

res/drawable-xxxhdpi/fdroid.png

14.8 KB
Loading
1.76 KB
Loading

res/drawable-xxxhdpi/playstore.png

13.6 KB
Loading

res/layout/participate_layout.xml

+165
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,165 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<!--
3+
Nextcloud Android client application
4+
5+
Copyright (C) 2016 Tobias Kaminsky
6+
Copyright (C) 2016 Nextcloud.
7+
8+
This program is free software; you can redistribute it and/or
9+
modify it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE
10+
License as published by the Free Software Foundation; either
11+
version 3 of the License, or any later version.
12+
13+
This program is distributed in the hope that it will be useful,
14+
but WITHOUT ANY WARRANTY; without even the implied warranty of
15+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16+
GNU AFFERO GENERAL PUBLIC LICENSE for more details.
17+
18+
You should have received a copy of the GNU Affero General Public
19+
License along with this program. If not, see <http://www.gnu.org/licenses/>.
20+
-->
21+
<android.support.v4.widget.DrawerLayout android:id="@+id/drawer_layout"
22+
xmlns:android="http://schemas.android.com/apk/res/android"
23+
android:layout_width="match_parent"
24+
android:layout_height="match_parent"
25+
android:clickable="true"
26+
android:fitsSystemWindows="true">
27+
28+
<!-- The main content view -->
29+
<LinearLayout
30+
android:layout_width="match_parent"
31+
android:layout_height="match_parent"
32+
android:orientation="vertical">
33+
34+
<include
35+
layout="@layout/toolbar_standard"/>
36+
37+
<ScrollView
38+
android:id="@+id/scrollView"
39+
android:layout_width="fill_parent"
40+
android:layout_height="wrap_content">
41+
42+
<LinearLayout
43+
android:layout_width="match_parent"
44+
android:layout_height="wrap_content"
45+
android:orientation="vertical"
46+
android:padding="@dimen/standard_padding">
47+
48+
<TextView
49+
android:id="@+id/participate_headline"
50+
android:layout_width="fill_parent"
51+
android:layout_height="wrap_content"
52+
android:text="@string/participate_testing_headline"
53+
android:textAppearance="?android:attr/textAppearanceLarge"/>
54+
55+
<TextView
56+
android:id="@+id/participate_testing_bug_text"
57+
android:layout_width="fill_parent"
58+
android:layout_height="wrap_content"
59+
android:paddingBottom="@dimen/standard_half_padding"
60+
android:text="@string/participate_testing_bug_text"
61+
android:textAppearance="?android:attr/textAppearanceMedium"/>
62+
63+
<android.support.v7.widget.AppCompatButton
64+
android:layout_width="wrap_content"
65+
android:layout_height="wrap_content"
66+
android:onClick="onReportIssueClick"
67+
android:text="@string/participate_testing_report_text"
68+
android:theme="@style/Button.Primary"/>
69+
70+
<TextView
71+
android:id="@+id/participate_text"
72+
android:layout_width="fill_parent"
73+
android:layout_height="wrap_content"
74+
android:paddingBottom="@dimen/standard_half_padding"
75+
android:paddingTop="@dimen/standard_half_padding"
76+
android:text="@string/participate_testing_version_text"
77+
android:textAppearance="?android:attr/textAppearanceMedium"/>
78+
79+
<TextView
80+
android:id="@+id/participate_release_candidate_headline"
81+
android:layout_width="fill_parent"
82+
android:layout_height="wrap_content"
83+
android:text="@string/participate_release_candidate_headline"
84+
android:textAppearance="?android:attr/textAppearanceLarge"/>
85+
86+
<TextView
87+
android:id="@+id/participate_release_candidate_text"
88+
android:layout_width="fill_parent"
89+
android:layout_height="wrap_content"
90+
android:text="@string/participate_release_candidate_text"
91+
android:textAppearance="?android:attr/textAppearanceMedium"/>
92+
93+
<LinearLayout
94+
android:layout_width="match_parent"
95+
android:layout_height="wrap_content">
96+
97+
<ImageButton
98+
android:id="@+id/participate_release_candidate_playstore"
99+
android:layout_width="wrap_content"
100+
android:layout_height="wrap_content"
101+
android:background="@color/white"
102+
android:onClick="onGetRCPlayStoreClick"
103+
android:padding="0dp"
104+
android:src="@drawable/playstore"/>
105+
106+
<ImageButton
107+
android:id="@+id/participate_release_candidate_fdroid"
108+
android:layout_width="wrap_content"
109+
android:layout_height="wrap_content"
110+
android:background="@color/white"
111+
android:onClick="onGetRCFDroidClick"
112+
android:padding="0dp"
113+
android:src="@drawable/fdroid"/>
114+
115+
</LinearLayout>
116+
117+
<TextView
118+
android:id="@+id/participate_beta_headline"
119+
android:layout_width="fill_parent"
120+
android:layout_height="wrap_content"
121+
android:text="@string/participate_beta_headline"
122+
android:textAppearance="?android:attr/textAppearanceLarge"/>
123+
124+
<TextView
125+
android:id="@+id/participate_beta_text"
126+
android:layout_width="fill_parent"
127+
android:layout_height="wrap_content"
128+
android:text="@string/participate_beta_text"
129+
android:textAppearance="?android:attr/textAppearanceMedium"/>
130+
131+
<ImageButton
132+
android:id="@+id/participate_beta_fdroid"
133+
android:layout_width="wrap_content"
134+
android:layout_height="wrap_content"
135+
android:background="@color/white"
136+
android:onClick="onGetBetaFDroidClick"
137+
android:padding="0dp"
138+
android:src="@drawable/fdroid"/>
139+
140+
<TextView
141+
android:id="@+id/participate_contribute_headline"
142+
android:layout_width="wrap_content"
143+
android:layout_height="wrap_content"
144+
android:text="@string/participate_contribute_headline"
145+
android:textAppearance="?android:attr/textAppearanceLarge"/>
146+
147+
<TextView
148+
android:id="@+id/participate_contribute_text"
149+
android:layout_width="wrap_content"
150+
android:layout_height="wrap_content"
151+
android:text="@string/participate_contribute_text"
152+
android:paddingLeft="@dimen/standard_half_padding"
153+
android:textAppearance="?android:attr/textAppearanceMedium"/>
154+
</LinearLayout>
155+
</ScrollView>
156+
157+
</LinearLayout>
158+
159+
<include
160+
layout="@layout/drawer"
161+
android:layout_width="240dp"
162+
android:layout_height="match_parent"
163+
android:layout_gravity="start"/>
164+
165+
</android.support.v4.widget.DrawerLayout>

res/menu/drawer_menu.xml

+6-1
Original file line numberDiff line numberDiff line change
@@ -60,12 +60,17 @@
6060
<!--
6161
all items in this group MUST have orderInCategory="3" set
6262
-->
63-
<group>
63+
<group android:id="@+id/drawer_menu_bottom" android:checkableBehavior="single">
6464
<item
6565
android:orderInCategory="3"
6666
android:id="@+id/nav_settings"
6767
android:icon="@drawable/ic_settings"
6868
android:title="@string/actionbar_settings"/>
69+
<item
70+
android:orderInCategory="3"
71+
android:id="@+id/nav_participate"
72+
android:icon="@drawable/ic_participate"
73+
android:title="@string/drawer_participate"/>
6974
</group>
7075

7176
<!--

res/values/setup.xml

+10
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,16 @@
7171
<!--Destination mail for sending log files -->
7272
<string name="mail_logger"></string>
7373

74+
<!-- Participate links -->
75+
<string name="fdroid_beta_link" translatable="false">https://f-droid.org/repository/browse/?fdid=com.nextcloud.android.beta</string>
76+
<string name="beta_apk_link" translatable="false">https://github.com/nextcloud/android/raw/beta/apks/latest.apk</string>
77+
<string name="play_store_register_beta" translatable="false">https://play.google.com/apps/testing/com.nextcloud.client</string>
78+
<string name="fdroid_link" translatable="false">https://f-droid.org/repository/browse/?fdid=com.nextcloud.client</string>
79+
<string name="irc_weblink" translatable="false">http://webchat.freenode.net?channels=nextcloud-mobile</string>
80+
<string name="help_link" translatable="false">https://help.nextcloud.com/c/clients/android</string>
81+
<string name="contributing_link" translatable="false">https://github.com/nextcloud/android/blob/master/CONTRIBUTING.md</string>
82+
<string name="report_issue_link" translatable="false">https://github.com/nextcloud/android/issues</string>
83+
7484
</resources>
7585

7686

res/values/strings.xml

+15
Original file line numberDiff line numberDiff line change
@@ -469,6 +469,21 @@
469469
<string name="actionbar_search">Search</string>
470470
<string name="files_drop_not_supported">This is a Nextcloud feature, please update.</string>
471471
<string name="learn_more">Learn more</string>
472+
<string name="drawer_participate">Participate</string>
473+
<string name="participate_testing_headline">Help us testing</string>
474+
<string name="participate_testing_bug_text">Found a bug? Something is odd?</string>
475+
<string name="participate_testing_report_text">Report an issue on Github</string>
476+
<string name="participate_testing_version_text">Interested in helping us testing the next Version?</string>
477+
<string name="participate_beta_headline">Test the Beta version</string>
478+
<string name="participate_beta_text">This includes all upcoming features and is very bleeding edge. Bugs/errors can occur and if they do, please report them to us. &lt;a href="%2$s">Download the APK&lt;/a> or</string>
479+
<string name="participate_release_candidate_headline">Release candidate</string>
480+
<string name="participate_release_candidate_text">The release candidate (RC) is a snapshot of the upcoming
481+
release and it is expected to be stable. Testing your individual setup could help to ensure this. Sign up for testing on the Play store or manually look in the \"versions\" section on F-Droid.</string>
482+
<string name="participate_contribute_headline">Actively Contribute</string>
483+
<string name="participate_contribute_text">&lt;ul>&lt;li>Join the chat on IRC: &lt;a
484+
href="%1$s">#nextcloud-mobile&lt;/a>&lt;/li>&lt;li>Help others on the &lt;a
485+
href="%2$s>forum&lt;/a>&lt;/li>&lt;li>Be part of the Team and contribute as a developer: &lt;a
486+
href="https://github.com/nextcloud/android/blob/master/CONTRIBUTING.md">Github CONTRIBUTING.md&lt;/a>&lt;/li&lt;/ul></string>
472487
<plurals name="items_selected_count">
473488
<!--
474489
As a developer, you should always supply "one" and "other"

src/com/owncloud/android/ui/activity/DrawerActivity.java

+20-10
Original file line numberDiff line numberDiff line change
@@ -272,6 +272,11 @@ public boolean onNavigationItemSelected(MenuItem menuItem) {
272272
Preferences.class);
273273
startActivity(settingsIntent);
274274
break;
275+
case R.id.nav_participate:
276+
Intent participateIntent = new Intent(getApplicationContext(),
277+
ParticipateActivity.class);
278+
startActivity(participateIntent);
279+
break;
275280
case R.id.drawer_menu_account_add:
276281
createAccount();
277282
break;
@@ -427,16 +432,19 @@ private void repopulateAccountList(Account[] accounts) {
427432
// add all accounts to list
428433
for (int i = 0; i < accounts.length; i++) {
429434
try {
430-
MenuItem accountMenuItem = mNavigationView.getMenu().add(
431-
R.id.drawer_menu_accounts,
432-
Menu.NONE,
433-
MENU_ORDER_ACCOUNT,
434-
accounts[i].name)
435-
.setIcon(TextDrawable.createAvatar(
436-
accounts[i].name,
437-
mMenuAccountAvatarRadiusDimension)
438-
);
439-
DisplayUtils.setAvatar(accounts[i], this, mMenuAccountAvatarRadiusDimension, getResources(), getStorageManager(), accountMenuItem);
435+
// show all accounts except the currently active one
436+
if (!getAccount().name.equals(accounts[i].name)) {
437+
MenuItem accountMenuItem = mNavigationView.getMenu().add(
438+
R.id.drawer_menu_accounts,
439+
Menu.NONE,
440+
MENU_ORDER_ACCOUNT,
441+
accounts[i].name)
442+
.setIcon(TextDrawable.createAvatar(
443+
accounts[i].name,
444+
mMenuAccountAvatarRadiusDimension)
445+
);
446+
DisplayUtils.setAvatar(accounts[i], this, mMenuAccountAvatarRadiusDimension, getResources(), getStorageManager(), accountMenuItem);
447+
}
440448
} catch (Exception e) {
441449
Log_OC.e(TAG, "Error calculating RGB value for account menu item.", e);
442450
mNavigationView.getMenu().add(
@@ -519,10 +527,12 @@ private void showMenu() {
519527
mAccountChooserToggle.setImageResource(R.drawable.ic_up);
520528
mNavigationView.getMenu().setGroupVisible(R.id.drawer_menu_accounts, true);
521529
mNavigationView.getMenu().setGroupVisible(R.id.drawer_menu_standard, false);
530+
mNavigationView.getMenu().setGroupVisible(R.id.drawer_menu_bottom, false);
522531
} else {
523532
mAccountChooserToggle.setImageResource(R.drawable.ic_down);
524533
mNavigationView.getMenu().setGroupVisible(R.id.drawer_menu_accounts, false);
525534
mNavigationView.getMenu().setGroupVisible(R.id.drawer_menu_standard, true);
535+
mNavigationView.getMenu().setGroupVisible(R.id.drawer_menu_bottom, true);
526536
}
527537
}
528538
}

0 commit comments

Comments
 (0)