Skip to content
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

chore: Update About The App section and rename it to 'About Us' #1904

Merged
merged 3 commits into from
Aug 19, 2019
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
6 changes: 6 additions & 0 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,9 @@ android {
}
defaultConfig {
multiDexEnabled true
resValue "string", "FACEBOOK_ID", "eventyay"
resValue "string", "TWITTER_ID", "eventyay"
resValue "string", "YOUTUBE_ID", "UCQprMsG-raCIMlBudm20iLQ"
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
Expand Down Expand Up @@ -262,6 +265,9 @@ dependencies {
// Mapbox
fdroidImplementation 'com.mapbox.mapboxsdk:mapbox-android-plugin-places-v8:0.9.0'

// About Page
implementation 'com.github.medyo:android-about-page:1.2.5'

//Testing
androidTestImplementation('androidx.test.espresso:espresso-core:3.2.0', {
exclude group: 'com.android.support', module: 'support-annotations'
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package com.eventyay.organizer.common.di.module.android;

import com.eventyay.organizer.core.about.AboutTheAppFragment;
import com.eventyay.organizer.core.about.AboutUsFragment;
import com.eventyay.organizer.core.attendee.checkin.AttendeeCheckInFragment;
import com.eventyay.organizer.core.attendee.history.CheckInHistoryFragment;
import com.eventyay.organizer.core.attendee.list.AttendeesFragment;
Expand Down Expand Up @@ -135,6 +135,6 @@ public abstract class MainFragmentBuildersModule {
// About the app

@ContributesAndroidInjector
abstract AboutTheAppFragment contributeAboutTheAppFragment();
abstract AboutUsFragment contributeAboutUsFragment();
}

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,112 @@
package com.eventyay.organizer.core.about;

import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.view.ContextThemeWrapper;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;

import androidx.annotation.Nullable;
import androidx.databinding.DataBindingUtil;
import androidx.fragment.app.FragmentTransaction;

import com.eventyay.organizer.BuildConfig;
import com.eventyay.organizer.R;
import com.eventyay.organizer.common.mvp.view.BaseFragment;
import com.eventyay.organizer.core.settings.AcknowledgementDecider;
import com.eventyay.organizer.core.settings.LegalPreferenceFragment;
import com.eventyay.organizer.databinding.AboutUsFragmentBinding;
import com.eventyay.organizer.utils.BrowserUtils;

import mehdi.sakout.aboutpage.AboutPage;
import mehdi.sakout.aboutpage.Element;

public class AboutUsFragment extends BaseFragment {

private AboutUsFragmentBinding binding;
private final AcknowledgementDecider acknowledgementDecider = new AcknowledgementDecider();

public static AboutUsFragment newInstance() {
return new AboutUsFragment();
}

@Override
public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
final Context contextThemeWrapper = new ContextThemeWrapper(getActivity(), R.style.AppTheme);
LayoutInflater localInflater = inflater.cloneInContext(contextThemeWrapper);
binding = DataBindingUtil.inflate(localInflater, R.layout.about_us_fragment, container, false);

Element legalElement = new Element();
legalElement.setTitle("Legal");

legalElement.setOnClickListener(v -> {
FragmentTransaction transaction = getFragmentManager().beginTransaction();
transaction
.replace(R.id.fragment, LegalPreferenceFragment.newInstance())
.addToBackStack(null)
.commit();
});

Element developersElement = new Element();
developersElement.setTitle(getString(R.string.developers));

developersElement.setOnClickListener(v -> {
BrowserUtils.launchUrl(getContext(), getString(R.string.github_developers_link));
});

Element shareElement = new Element();
shareElement.setTitle(getString(R.string.share));

shareElement.setOnClickListener(v -> {
Intent sharingIntent = new Intent();
sharingIntent.setAction(Intent.ACTION_SEND);
sharingIntent.setType("text/plain");
String shareSub = getString(R.string.msg_check_out);
String shareBody = getString(R.string.msg_check_this_out) + getString(R.string.play_store_link);
String shareTitle = getString(R.string.msg_share_using);
sharingIntent.putExtra(Intent.EXTRA_SUBJECT, shareSub);
sharingIntent.putExtra(Intent.EXTRA_TEXT, shareBody);
startActivity(Intent.createChooser(sharingIntent, shareTitle));
ShridharGoel marked this conversation as resolved.
Show resolved Hide resolved
});

Element thirdPartyLicenses = new Element();
thirdPartyLicenses.setTitle(getString(R.string.third_party_licenses));

thirdPartyLicenses.setOnClickListener(v -> {
acknowledgementDecider.openAcknowledgementsSection(getContext());
});

AboutPage aboutPage = new AboutPage(getContext())
.isRTL(false)
.setImage(R.mipmap.ic_launcher)
.setDescription(getString(R.string.about_us_description))
.addItem(new Element("Version " + BuildConfig.VERSION_NAME, R.drawable.ic_info))
.addGroup("Connect with us")
.addGitHub("fossasia/open-event-organizer-android")
ShridharGoel marked this conversation as resolved.
Show resolved Hide resolved
.addPlayStore(getContext().getPackageName())
.addWebsite(getString(R.string.FRONTEND_HOST))
.addFacebook(getString(R.string.FACEBOOK_ID))
.addTwitter(getString(R.string.TWITTER_ID))
.addYoutube(getString(R.string.YOUTUBE_ID))
.addItem(developersElement)
.addItem(legalElement)
.addItem(shareElement);

if (BuildConfig.FLAVOR.equals("playStore")) {
aboutPage.addItem(thirdPartyLicenses);
}

View aboutPageView = aboutPage.create();

binding.fragment.addView(aboutPageView);

return binding.getRoot();
}

@Override
protected int getTitle() {
return R.string.about_us;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import androidx.fragment.app.FragmentTransaction;

import com.eventyay.organizer.R;
import com.eventyay.organizer.core.about.AboutTheAppFragment;
import com.eventyay.organizer.core.about.AboutUsFragment;
import com.eventyay.organizer.core.attendee.list.AttendeesFragment;
import com.eventyay.organizer.core.event.dashboard.EventDashboardFragment;
import com.eventyay.organizer.core.event.list.EventListFragment;
Expand Down Expand Up @@ -87,8 +87,8 @@ void loadFragment(int navItemId) {
case R.id.nav_events:
fragment = EventListFragment.newInstance();
break;
case R.id.nav_about_the_app:
fragment = AboutTheAppFragment.newInstance();
case R.id.nav_about_us:
fragment = AboutUsFragment.newInstance();
break;
case R.id.nav_settings:
fragment = SettingsFragment.newInstance();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,49 +69,6 @@ public void onCreatePreferencesFix(@Nullable Bundle bundle, String rootKey) {
return true;
});

findPreference(getString(R.string.app_version_key)).setTitle(VERSION + " " + BuildConfig.VERSION_NAME);

findPreference("rate_us").setOnPreferenceClickListener(preference -> {
Uri uri = Uri.parse("market://details?id=" + BuildConfig.APPLICATION_ID);
Intent playStoreIntent = new Intent(Intent.ACTION_VIEW, uri);
try {
startActivity(playStoreIntent);
} catch (ActivityNotFoundException e) {
startActivity(new Intent(Intent.ACTION_VIEW,
Uri.parse("http://play.google.com/store/apps/details?id=" + BuildConfig.APPLICATION_ID)));
}
return true;
});

findPreference(getString(R.string.legal_key)).setOnPreferenceClickListener(preference -> {
FragmentTransaction transaction = getFragmentManager().beginTransaction();
transaction
.replace(R.id.fragment_container, LegalPreferenceFragment.newInstance())
.addToBackStack(null)
.commit();
return true;
});

findPreference(getString(R.string.share_app_key)).setOnPreferenceClickListener(preference -> {
Intent sharingIntent = new Intent();
sharingIntent.setAction(Intent.ACTION_SEND);
sharingIntent.setType("text/plain");
String shareSub = getString(R.string.msg_check_out);
String shareBody = getString(R.string.msg_check_this_out) + getString(R.string.play_store_link);
String shareTitle = getString(R.string.msg_share_using);
sharingIntent.putExtra(Intent.EXTRA_SUBJECT, shareSub);
sharingIntent.putExtra(Intent.EXTRA_TEXT, shareBody);
startActivity(Intent.createChooser(sharingIntent, shareTitle));
return true;
});

findPreference(getString(R.string.acknowledgements_key)).setVisible(acknowledgementDecider.shouldShowAcknowledgement());

findPreference(getString(R.string.acknowledgements_key)).setOnPreferenceClickListener(preference -> {
acknowledgementDecider.openAcknowledgementsSection(getActivity());
return true;
});

findPreference("developer_mode").setOnPreferenceClickListener(preference -> {
isDeveloperModeEnabled = manager.getSharedPreferences().getBoolean(
getString(R.string.developer_mode_key), false);
Expand Down
93 changes: 0 additions & 93 deletions app/src/main/res/layout/about_the_app_fragment.xml

This file was deleted.

15 changes: 15 additions & 0 deletions app/src/main/res/layout/about_us_fragment.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<?xml version="1.0" encoding="utf-8"?>

<layout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto">

<FrameLayout
android:id="@+id/fragment"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fitsSystemWindows="true"
app:layout_behavior="@string/appbar_scrolling_view_behavior">

</FrameLayout>

</layout>
4 changes: 2 additions & 2 deletions app/src/main/res/menu/activity_main_drawer.xml
Original file line number Diff line number Diff line change
Expand Up @@ -107,9 +107,9 @@
<group android:id="@+id/mainMenu">

<item
android:id="@+id/nav_about_the_app"
android:id="@+id/nav_about_us"
android:icon="@drawable/ic_info"
android:title="@string/about_the_app"
android:title="@string/about_us"
android:checkable="true"/>

<item
Expand Down
Loading