Browse Source

fixes:

- remove orange color when user is mentioned in inbox
- fix bug where user could not press back on CreatePMActivity
- Fix toolbar text of CreatePMActivity
pms
Thodoris Tyrovouzis 5 years ago
parent
commit
93a1f7c2f5
  1. 17
      app/src/main/java/gr/thmmy/mthmmy/activities/create_pm/CreatePMActivity.java
  2. 9
      app/src/main/java/gr/thmmy/mthmmy/activities/create_topic/CreateTopicActivity.java
  3. 6
      app/src/main/java/gr/thmmy/mthmmy/activities/inbox/InboxAdapter.java
  4. 2
      app/src/main/res/layout/activity_create_pm.xml

17
app/src/main/java/gr/thmmy/mthmmy/activities/create_pm/CreatePMActivity.java

@ -50,13 +50,15 @@ public class CreatePMActivity extends BaseActivity implements ExternalAsyncTask.
//Initialize toolbar
toolbar = findViewById(R.id.toolbar);
toolbar.setTitle("Create topic");
toolbar.setTitle("Create PM");
setSupportActionBar(toolbar);
if (getSupportActionBar() != null) {
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
getSupportActionBar().setDisplayShowHomeEnabled(true);
}
createDrawer();
progressBar = findViewById(R.id.progressBar);
emojiKeyboard = findViewById(R.id.emoji_keyboard);
@ -69,10 +71,6 @@ public class CreatePMActivity extends BaseActivity implements ExternalAsyncTask.
contentEditor.setEmojiKeyboard(emojiKeyboard);
emojiKeyboard.registerEmojiInputField(contentEditor);
contentEditor.setOnSubmitListener(v -> {
if (TextUtils.isEmpty(subjectInput.getEditText().getText())) {
subjectInput.setError("Required");
return;
}
if (TextUtils.isEmpty(contentEditor.getText())) {
contentEditor.setError("Required");
return;
@ -97,11 +95,14 @@ public class CreatePMActivity extends BaseActivity implements ExternalAsyncTask.
@Override
public void onBackPressed() {
if (emojiKeyboard.getVisibility() == View.VISIBLE) {
if (drawer.isDrawerOpen()) {
drawer.closeDrawer();
return;
} else if (emojiKeyboard.getVisibility() == View.VISIBLE) {
emojiKeyboard.setVisibility(View.GONE);
} else {
super.onBackPressed();
return;
}
super.onBackPressed();
}

9
app/src/main/java/gr/thmmy/mthmmy/activities/create_topic/CreateTopicActivity.java

@ -83,11 +83,14 @@ public class CreateTopicActivity extends BaseActivity implements NewTopicTask.Ne
}
@Override
public void onBackPressed() {
if (emojiKeyboard.getVisibility() == View.VISIBLE) {
if (drawer.isDrawerOpen()) {
drawer.closeDrawer();
return;
} else if (emojiKeyboard.getVisibility() == View.VISIBLE) {
emojiKeyboard.setVisibility(View.GONE);
} else {
super.onBackPressed();
return;
}
super.onBackPressed();
}
@Override

6
app/src/main/java/gr/thmmy/mthmmy/activities/inbox/InboxAdapter.java

@ -142,14 +142,16 @@ public class InboxAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder>
holder.stars.setVisibility(View.VISIBLE);
} else holder.stars.setVisibility(View.GONE);
if (currentPM.isUserMentioned()) {
// in the context of inbox there is no point in highlighting quoted PMs
/*if (currentPM.isUserMentioned()) {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
holder.cardChildLinear.setBackground(context.getResources().
getDrawable(R.drawable.mention_card, null));
} else
holder.cardChildLinear.setBackground(context.getResources().
getDrawable(R.drawable.mention_card));
} else if (currentPM.getAuthorColor() == ParseHelpers.USER_COLOR_PINK) {
} else */
if (currentPM.getAuthorColor() == ParseHelpers.USER_COLOR_PINK) {
//Special card for special member of the month!
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
holder.cardChildLinear.setBackground(context.getResources().

2
app/src/main/res/layout/activity_create_pm.xml

@ -24,7 +24,7 @@
android:layout_height="?attr/actionBarSize"
android:background="?attr/colorPrimary"
android:gravity="center"
app:popupTheme="@style/ToolbarTheme"></androidx.appcompat.widget.Toolbar>
app:popupTheme="@style/ToolbarTheme" />
</com.google.android.material.appbar.AppBarLayout>
<include

Loading…
Cancel
Save