Skip to content

Commit

Permalink
Merge pull request #239 from nextcloud/participate
Browse files Browse the repository at this point in the history
Motivate more users
  • Loading branch information
AndyScherzinger authored Sep 6, 2016
2 parents 0bec9c3 + 07f5d95 commit dfec474
Show file tree
Hide file tree
Showing 14 changed files with 335 additions and 11 deletions.
1 change: 1 addition & 0 deletions AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@
</intent-filter>
</activity>
<activity android:name=".ui.activity.ManageAccountsActivity" />
<activity android:name=".ui.activity.ParticipateActivity" />
<activity android:name=".ui.activity.UploadFilesActivity" />
<activity android:name=".ui.activity.ReceiveExternalFilesActivity"
android:taskAffinity=""
Expand Down
Binary file added res/drawable-hdpi/ic_participate.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added res/drawable-mdpi/ic_participate.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added res/drawable-xhdpi/ic_participate.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added res/drawable-xxhdpi/ic_participate.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added res/drawable-xxxhdpi/fdroid.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added res/drawable-xxxhdpi/ic_participate.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added res/drawable-xxxhdpi/playstore.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
165 changes: 165 additions & 0 deletions res/layout/participate_layout.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,165 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
Nextcloud Android client application
Copyright (C) 2016 Tobias Kaminsky
Copyright (C) 2016 Nextcloud.
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE
License as published by the Free Software Foundation; either
version 3 of the License, or any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU AFFERO GENERAL PUBLIC LICENSE for more details.
You should have received a copy of the GNU Affero General Public
License along with this program. If not, see <http://www.gnu.org/licenses/>.
-->
<android.support.v4.widget.DrawerLayout android:id="@+id/drawer_layout"
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:clickable="true"
android:fitsSystemWindows="true">

<!-- The main content view -->
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">

<include
layout="@layout/toolbar_standard"/>

<ScrollView
android:id="@+id/scrollView"
android:layout_width="fill_parent"
android:layout_height="wrap_content">

<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:padding="@dimen/standard_padding">

<TextView
android:id="@+id/participate_headline"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="@string/participate_testing_headline"
android:textAppearance="?android:attr/textAppearanceLarge"/>

<TextView
android:id="@+id/participate_testing_bug_text"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:paddingBottom="@dimen/standard_half_padding"
android:text="@string/participate_testing_bug_text"
android:textAppearance="?android:attr/textAppearanceMedium"/>

<android.support.v7.widget.AppCompatButton
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:onClick="onReportIssueClick"
android:text="@string/participate_testing_report_text"
android:theme="@style/Button.Primary"/>

<TextView
android:id="@+id/participate_text"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:paddingBottom="@dimen/standard_half_padding"
android:paddingTop="@dimen/standard_half_padding"
android:text="@string/participate_testing_version_text"
android:textAppearance="?android:attr/textAppearanceMedium"/>

<TextView
android:id="@+id/participate_release_candidate_headline"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="@string/participate_release_candidate_headline"
android:textAppearance="?android:attr/textAppearanceLarge"/>

<TextView
android:id="@+id/participate_release_candidate_text"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="@string/participate_release_candidate_text"
android:textAppearance="?android:attr/textAppearanceMedium"/>

<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">

<ImageButton
android:id="@+id/participate_release_candidate_playstore"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@color/white"
android:onClick="onGetRCPlayStoreClick"
android:padding="0dp"
android:src="@drawable/playstore"/>

<ImageButton
android:id="@+id/participate_release_candidate_fdroid"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@color/white"
android:onClick="onGetRCFDroidClick"
android:padding="0dp"
android:src="@drawable/fdroid"/>

</LinearLayout>

<TextView
android:id="@+id/participate_beta_headline"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="@string/participate_beta_headline"
android:textAppearance="?android:attr/textAppearanceLarge"/>

<TextView
android:id="@+id/participate_beta_text"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="@string/participate_beta_text"
android:textAppearance="?android:attr/textAppearanceMedium"/>

<ImageButton
android:id="@+id/participate_beta_fdroid"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@color/white"
android:onClick="onGetBetaFDroidClick"
android:padding="0dp"
android:src="@drawable/fdroid"/>

<TextView
android:id="@+id/participate_contribute_headline"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/participate_contribute_headline"
android:textAppearance="?android:attr/textAppearanceLarge"/>

<TextView
android:id="@+id/participate_contribute_text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/participate_contribute_text"
android:paddingLeft="@dimen/standard_half_padding"
android:textAppearance="?android:attr/textAppearanceMedium"/>
</LinearLayout>
</ScrollView>

</LinearLayout>

<include
layout="@layout/drawer"
android:layout_width="240dp"
android:layout_height="match_parent"
android:layout_gravity="start"/>

</android.support.v4.widget.DrawerLayout>
7 changes: 6 additions & 1 deletion res/menu/drawer_menu.xml
Original file line number Diff line number Diff line change
Expand Up @@ -60,12 +60,17 @@
<!--
all items in this group MUST have orderInCategory="3" set
-->
<group>
<group android:id="@+id/drawer_menu_bottom" android:checkableBehavior="single">
<item
android:orderInCategory="3"
android:id="@+id/nav_settings"
android:icon="@drawable/ic_settings"
android:title="@string/actionbar_settings"/>
<item
android:orderInCategory="3"
android:id="@+id/nav_participate"
android:icon="@drawable/ic_participate"
android:title="@string/drawer_participate"/>
</group>

<!--
Expand Down
10 changes: 10 additions & 0 deletions res/values/setup.xml
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,16 @@
<!--Destination mail for sending log files -->
<string name="mail_logger"></string>

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

</resources>


15 changes: 15 additions & 0 deletions res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -469,6 +469,21 @@
<string name="actionbar_search">Search</string>
<string name="files_drop_not_supported">This is a Nextcloud feature, please update.</string>
<string name="learn_more">Learn more</string>
<string name="drawer_participate">Participate</string>
<string name="participate_testing_headline">Help us testing</string>
<string name="participate_testing_bug_text">Found a bug? Something is odd?</string>
<string name="participate_testing_report_text">Report an issue on Github</string>
<string name="participate_testing_version_text">Interested in helping us testing the next Version?</string>
<string name="participate_beta_headline">Test the Beta version</string>
<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>
<string name="participate_release_candidate_headline">Release candidate</string>
<string name="participate_release_candidate_text">The release candidate (RC) is a snapshot of the upcoming
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>
<string name="participate_contribute_headline">Actively Contribute</string>
<string name="participate_contribute_text">&lt;ul>&lt;li>Join the chat on IRC: &lt;a
href="%1$s">#nextcloud-mobile&lt;/a>&lt;/li>&lt;li>Help others on the &lt;a
href="%2$s>forum&lt;/a>&lt;/li>&lt;li>Be part of the Team and contribute as a developer: &lt;a
href="https://github.com/nextcloud/android/blob/master/CONTRIBUTING.md">Github CONTRIBUTING.md&lt;/a>&lt;/li&lt;/ul></string>
<plurals name="items_selected_count">
<!--
As a developer, you should always supply "one" and "other"
Expand Down
30 changes: 20 additions & 10 deletions src/com/owncloud/android/ui/activity/DrawerActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -272,6 +272,11 @@ public boolean onNavigationItemSelected(MenuItem menuItem) {
Preferences.class);
startActivity(settingsIntent);
break;
case R.id.nav_participate:
Intent participateIntent = new Intent(getApplicationContext(),
ParticipateActivity.class);
startActivity(participateIntent);
break;
case R.id.drawer_menu_account_add:
createAccount();
break;
Expand Down Expand Up @@ -427,16 +432,19 @@ private void repopulateAccountList(Account[] accounts) {
// add all accounts to list
for (int i = 0; i < accounts.length; i++) {
try {
MenuItem accountMenuItem = mNavigationView.getMenu().add(
R.id.drawer_menu_accounts,
Menu.NONE,
MENU_ORDER_ACCOUNT,
accounts[i].name)
.setIcon(TextDrawable.createAvatar(
accounts[i].name,
mMenuAccountAvatarRadiusDimension)
);
DisplayUtils.setAvatar(accounts[i], this, mMenuAccountAvatarRadiusDimension, getResources(), getStorageManager(), accountMenuItem);
// show all accounts except the currently active one
if (!getAccount().name.equals(accounts[i].name)) {
MenuItem accountMenuItem = mNavigationView.getMenu().add(
R.id.drawer_menu_accounts,
Menu.NONE,
MENU_ORDER_ACCOUNT,
accounts[i].name)
.setIcon(TextDrawable.createAvatar(
accounts[i].name,
mMenuAccountAvatarRadiusDimension)
);
DisplayUtils.setAvatar(accounts[i], this, mMenuAccountAvatarRadiusDimension, getResources(), getStorageManager(), accountMenuItem);
}
} catch (Exception e) {
Log_OC.e(TAG, "Error calculating RGB value for account menu item.", e);
mNavigationView.getMenu().add(
Expand Down Expand Up @@ -519,10 +527,12 @@ private void showMenu() {
mAccountChooserToggle.setImageResource(R.drawable.ic_up);
mNavigationView.getMenu().setGroupVisible(R.id.drawer_menu_accounts, true);
mNavigationView.getMenu().setGroupVisible(R.id.drawer_menu_standard, false);
mNavigationView.getMenu().setGroupVisible(R.id.drawer_menu_bottom, false);
} else {
mAccountChooserToggle.setImageResource(R.drawable.ic_down);
mNavigationView.getMenu().setGroupVisible(R.id.drawer_menu_accounts, false);
mNavigationView.getMenu().setGroupVisible(R.id.drawer_menu_standard, true);
mNavigationView.getMenu().setGroupVisible(R.id.drawer_menu_bottom, true);
}
}
}
Expand Down
Loading

0 comments on commit dfec474

Please sign in to comment.