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
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
import com.a494studios.koreanconjugator.ConjugationQuery;
import com.a494studios.koreanconjugator.CustomApplication;
import com.a494studios.koreanconjugator.EntryQuery;
import com.a494studios.koreanconjugator.ExamplesQuery;
import com.a494studios.koreanconjugator.FavoritesQuery;
import com.a494studios.koreanconjugator.SearchQuery;
import com.a494studios.koreanconjugator.StemQuery;
Expand Down Expand Up @@ -52,7 +51,7 @@ public static Observable<Response<SearchQuery.Data>> doSearchQuery(String query,
return Rx2Apollo.from(call)
.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
.filter((dataResponse) -> dataResponse.data() != null);
.filter((dataResponse) -> dataResponse.getData() != null);
}

public static Observable<Response<EntryQuery.Data>> doEntryQuery(final String id, CustomApplication app) {
Expand All @@ -63,8 +62,8 @@ public static Observable<Response<EntryQuery.Data>> doEntryQuery(final String id
return Rx2Apollo.from(call)
.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
.filter((dataResponse) -> dataResponse.data() != null)
.doFinally(() -> idler.decrement());
.filter((dataResponse) -> dataResponse.getData() != null)
.doAfterTerminate(() -> idler.decrement());
}

public static Observable<Response<ConjugationQuery.Data>> doConjugationQuery(
Expand Down Expand Up @@ -94,8 +93,8 @@ public static Observable<Response<ConjugationQuery.Data>> doConjugationQuery(
return Rx2Apollo.from(call)
.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
.filter((dataResponse) -> dataResponse.data() != null)
.doFinally(() -> idler.decrement());
.filter((dataResponse) -> dataResponse.getData() != null)
.doAfterTerminate(() -> idler.decrement());
}

public static Observable<Response<FavoritesQuery.Data>> doFavoritesQuery(
Expand All @@ -117,19 +116,8 @@ public static Observable<Response<FavoritesQuery.Data>> doFavoritesQuery(
return Rx2Apollo.from(call)
.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
.filter((dataResponse) -> dataResponse.data() != null)
.doFinally(() -> idler.decrement());
}

public static Observable<Response<ExamplesQuery.Data>> doExamplesQuery(final String id, CustomApplication app) {
ApolloQueryCall<ExamplesQuery.Data> call = getApolloClient(app)
.query(new ExamplesQuery(id))
.httpCachePolicy(HttpCachePolicy.CACHE_FIRST);
return Rx2Apollo.from(call)
.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
.filter((dataResponse) -> dataResponse.data() != null);

.filter((dataResponse) -> dataResponse.getData() != null)
.doAfterTerminate(() -> idler.decrement());
}

public static Observable<Response<ConjugationNamesQuery.Data>> doConjugationNamesQuery(CustomApplication app) {
Expand All @@ -139,7 +127,7 @@ public static Observable<Response<ConjugationNamesQuery.Data>> doConjugationName
return Rx2Apollo.from(call)
.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
.filter((dataResponse -> dataResponse.data() != null));
.filter((dataResponse -> dataResponse.getData() != null));
}

public static Observable<Response<WordOfTheDayQuery.Data>> doWODQuery(CustomApplication app) {
Expand All @@ -153,8 +141,8 @@ public static Observable<Response<WordOfTheDayQuery.Data>> doWODQuery(CustomAppl
return Rx2Apollo.from(call)
.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
.filter((dataResponse -> dataResponse.data() != null))
.doFinally(() -> idler.decrement());
.filter((dataResponse -> dataResponse.getData() != null))
.doAfterTerminate(() -> idler.decrement());
}

public static Observable<Response<StemQuery.Data>> doStemQuery(String term, CustomApplication app) {
Expand All @@ -168,7 +156,7 @@ public static Observable<Response<StemQuery.Data>> doStemQuery(String term, Cust
return Rx2Apollo.from(call)
.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
.filter((dataResponse -> dataResponse.data() != null));
.filter((dataResponse -> dataResponse.getData() != null));
}

private static ApolloClient getApolloClient(CustomApplication app) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@

import com.a494studios.koreanconjugator.BuildConfig;
import com.a494studios.koreanconjugator.R;
import com.google.android.material.textfield.TextInputLayout;
import com.google.firebase.crashlytics.FirebaseCrashlytics;

import org.rm3l.maoni.common.contract.Handler;
Expand All @@ -30,6 +31,7 @@ public class SlackHandler implements Handler {
private AppCompatActivity context;
private SlackWebApiClient webApiClient;
private RadioGroup radioGroup;
private TextInputLayout emailField;

public SlackHandler(AppCompatActivity context){
this.context = context;
Expand All @@ -39,6 +41,7 @@ public SlackHandler(AppCompatActivity context){
@Override
public void onCreate(View view, Bundle bundle) {
radioGroup = view.findViewById(R.id.extra_radiogroup);
emailField = view.findViewById(R.id.extra_emailField);
}

@Override
Expand Down Expand Up @@ -95,6 +98,14 @@ public void run() {

body.append(feedback.userComment).append("\n\n");

body.append("Email: ");
String email = emailField.getEditText().getText().toString();
if(email.length() > 0) {
body.append(email);
} else {
body.append("None given");
}

body.append("\n------ Application ------\n");
if (feedback.appInfo != null) {
if (feedback.appInfo.caller != null) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ public static Maoni makeMaoniActivity(AppCompatActivity context){
.withLogsCapturingFeature(false)
.withHandler(listener)
.withExtraLayout(R.layout.activity_maoni_extra)
.withHeader(R.drawable.feedback_header)
.withHeader(R.color.colorPrimary)
.withTheme(R.style.AppTheme_NoActionBar)
.build();
}
Expand Down
34 changes: 0 additions & 34 deletions app/src/main/res/drawable/feedback_header.xml

This file was deleted.

23 changes: 18 additions & 5 deletions app/src/main/res/layout/activity_maoni_extra.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,25 @@
android:orientation="vertical" android:layout_width="match_parent"
android:layout_height="match_parent">

<com.google.android.material.textfield.TextInputLayout
android:id="@+id/extra_emailField"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginVertical="16dp"
android:hint="@string/email_label">

<com.google.android.material.textfield.TextInputEditText
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:imeOptions="actionDone"
android:inputType="text" />
</com.google.android.material.textfield.TextInputLayout>

<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="Select Feedback Type"
android:text="@string/feedback_type_title"
android:textColor="@android:color/black"
android:paddingTop="8dp"
android:paddingBottom="16dp"/>

<RadioGroup
Expand All @@ -22,20 +35,20 @@
android:layout_height="wrap_content"
android:layout_marginBottom="8dp"
android:checked="true"
android:text="Found a Bug"/>
android:text="@string/bug_option"/>
<RadioButton
android:id="@+id/extra_feature_btn"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginBottom="8dp"
android:checked="false"
android:text="Suggesting a New Feature"/>
android:text="@string/new_feature_option"/>
<RadioButton
android:id="@+id/extra_hi_btn"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginBottom="8dp"
android:checked="false"
android:text="Just Saying Hi"/>
android:text="@string/other_option"/>
</RadioGroup>
</LinearLayout>
6 changes: 6 additions & 0 deletions app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,12 @@
<string name="feed_rate_never">Never</string>
<string name="feedback_sent">Feedback sent</string>
<string name="feedback_sending">Sending feedback</string>
<!--Maoni Activity-->
<string name="email_label">Email (optional)</string>
<string name="feedback_type_title">Select Feedback Type</string>
<string name="bug_option">Found a Bug</string>
<string name="new_feature_option">Suggesting a New Feature</string>
<string name="other_option">Just Saying Hi</string>
<!--Onboarding-->
<string name="onboarding1_title">Hanji 2.0</string>
<string name="onboarding1_desc">Welcome to Hanji 2.0! This new update adds a ton of new features and takes Hanji to the next level.</string>
Expand Down
1 change: 1 addition & 0 deletions app/src/main/res/values/styles.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
<item name="colorPrimaryDark">@color/colorPrimaryDark</item>
<item name="colorAccent">@color/colorAccent</item>
<item name="colorSecondary">@color/colorAccent</item>
<item name="colorOnSecondary">@color/white</item>
<item name="popupMenuStyle">@style/OverflowMenuStyle</item>
<item name="colorSurface">@color/white</item>
<item name="alertDialogTheme">@style/AlertDialogTheme</item>
Expand Down