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 //Initialize toolbar
toolbar = findViewById(R.id.toolbar); toolbar = findViewById(R.id.toolbar);
toolbar.setTitle("Create topic"); toolbar.setTitle("Create PM");
setSupportActionBar(toolbar); setSupportActionBar(toolbar);
if (getSupportActionBar() != null) { if (getSupportActionBar() != null) {
getSupportActionBar().setDisplayHomeAsUpEnabled(true); getSupportActionBar().setDisplayHomeAsUpEnabled(true);
getSupportActionBar().setDisplayShowHomeEnabled(true); getSupportActionBar().setDisplayShowHomeEnabled(true);
} }
createDrawer();
progressBar = findViewById(R.id.progressBar); progressBar = findViewById(R.id.progressBar);
emojiKeyboard = findViewById(R.id.emoji_keyboard); emojiKeyboard = findViewById(R.id.emoji_keyboard);
@ -69,10 +71,6 @@ public class CreatePMActivity extends BaseActivity implements ExternalAsyncTask.
contentEditor.setEmojiKeyboard(emojiKeyboard); contentEditor.setEmojiKeyboard(emojiKeyboard);
emojiKeyboard.registerEmojiInputField(contentEditor); emojiKeyboard.registerEmojiInputField(contentEditor);
contentEditor.setOnSubmitListener(v -> { contentEditor.setOnSubmitListener(v -> {
if (TextUtils.isEmpty(subjectInput.getEditText().getText())) {
subjectInput.setError("Required");
return;
}
if (TextUtils.isEmpty(contentEditor.getText())) { if (TextUtils.isEmpty(contentEditor.getText())) {
contentEditor.setError("Required"); contentEditor.setError("Required");
return; return;
@ -97,11 +95,14 @@ public class CreatePMActivity extends BaseActivity implements ExternalAsyncTask.
@Override @Override
public void onBackPressed() { public void onBackPressed() {
if (emojiKeyboard.getVisibility() == View.VISIBLE) { if (drawer.isDrawerOpen()) {
drawer.closeDrawer();
return;
} else if (emojiKeyboard.getVisibility() == View.VISIBLE) {
emojiKeyboard.setVisibility(View.GONE); emojiKeyboard.setVisibility(View.GONE);
} else { return;
super.onBackPressed();
} }
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 @Override
public void onBackPressed() { public void onBackPressed() {
if (emojiKeyboard.getVisibility() == View.VISIBLE) { if (drawer.isDrawerOpen()) {
drawer.closeDrawer();
return;
} else if (emojiKeyboard.getVisibility() == View.VISIBLE) {
emojiKeyboard.setVisibility(View.GONE); emojiKeyboard.setVisibility(View.GONE);
} else { return;
super.onBackPressed();
} }
super.onBackPressed();
} }
@Override @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); holder.stars.setVisibility(View.VISIBLE);
} else holder.stars.setVisibility(View.GONE); } 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) { if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
holder.cardChildLinear.setBackground(context.getResources(). holder.cardChildLinear.setBackground(context.getResources().
getDrawable(R.drawable.mention_card, null)); getDrawable(R.drawable.mention_card, null));
} else } else
holder.cardChildLinear.setBackground(context.getResources(). holder.cardChildLinear.setBackground(context.getResources().
getDrawable(R.drawable.mention_card)); 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! //Special card for special member of the month!
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) { if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
holder.cardChildLinear.setBackground(context.getResources(). 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:layout_height="?attr/actionBarSize"
android:background="?attr/colorPrimary" android:background="?attr/colorPrimary"
android:gravity="center" android:gravity="center"
app:popupTheme="@style/ToolbarTheme"></androidx.appcompat.widget.Toolbar> app:popupTheme="@style/ToolbarTheme" />
</com.google.android.material.appbar.AppBarLayout> </com.google.android.material.appbar.AppBarLayout>
<include <include

Loading…
Cancel
Save