Browse Source

Added username color, minor gradle fixes

pull/24/head
Apostolos Fanakis 7 years ago
parent
commit
d323dd9cb9
  1. 8
      app/build.gradle
  2. 2
      app/src/main/java/gr/thmmy/mthmmy/activities/profile/latestPosts/LatestPostsAdapter.java
  3. 7
      app/src/main/java/gr/thmmy/mthmmy/activities/topic/TopicAdapter.java
  4. 3
      app/src/main/java/gr/thmmy/mthmmy/activities/topic/TopicParser.java

8
app/build.gradle

@ -19,10 +19,10 @@ android {
minifyEnabled true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
/*debug {
def date = new Date().format('ddMMyy_HHmmss');
debug {
def date = new Date().format('ddMMyy_HHmmss')
archivesBaseName = archivesBaseName + "-$date"
}*/
}
}
}
@ -50,6 +50,6 @@ dependencies {
compile 'com.jakewharton.timber:timber:4.5.1'
}
if (!getGradle().getStartParameter().getTaskRequests().toString().contains("Debug")){
if (getGradle().getStartParameter().getTaskRequests().toString().contains("Release")){
apply plugin: 'com.google.gms.google-services'
}

2
app/src/main/java/gr/thmmy/mthmmy/activities/profile/latestPosts/LatestPostsAdapter.java

@ -1,7 +1,6 @@
package gr.thmmy.mthmmy.activities.profile.latestPosts;
import android.support.v7.widget.RecyclerView;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
@ -47,7 +46,6 @@ class LatestPostsAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder> {
@Override
public RecyclerView.ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
if (viewType == VIEW_TYPE_EMPTY) {
Log.d("This", "in");
View view = LayoutInflater.from(parent.getContext()).
inflate(R.layout.fragment_latest_posts_empty_message, parent, false);
return new RecyclerView.ViewHolder(view){};

7
app/src/main/java/gr/thmmy/mthmmy/activities/topic/TopicAdapter.java

@ -62,6 +62,8 @@ import static gr.thmmy.mthmmy.activities.profile.ProfileActivity.BUNDLE_PROFILE_
import static gr.thmmy.mthmmy.activities.profile.ProfileActivity.BUNDLE_PROFILE_URL;
import static gr.thmmy.mthmmy.activities.profile.ProfileActivity.BUNDLE_PROFILE_USERNAME;
import static gr.thmmy.mthmmy.activities.topic.Posting.htmlToBBcode;
import static gr.thmmy.mthmmy.activities.topic.TopicParser.USER_COLOR_WHITE;
import static gr.thmmy.mthmmy.activities.topic.TopicParser.USER_COLOR_YELLOW;
import static gr.thmmy.mthmmy.base.BaseActivity.getSessionManager;
/**
@ -309,6 +311,11 @@ class TopicAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder> {
holder.personalText.setVisibility(View.VISIBLE);
} else
holder.personalText.setVisibility(View.GONE);
if (mUserColor != USER_COLOR_YELLOW){
holder.username.setTextColor(mUserColor);
} else {
holder.username.setTextColor(USER_COLOR_WHITE);
}
if (mNumberOfStars > 0) {
holder.stars.setTypeface(Typeface.createFromAsset(context.getAssets()
, "fonts/fontawesome-webfont.ttf"));

3
app/src/main/java/gr/thmmy/mthmmy/activities/topic/TopicParser.java

@ -35,7 +35,8 @@ class TopicParser {
private static final int USER_COLOR_GREEN = Color.parseColor("#4CAF50");
private static final int USER_COLOR_BLUE = Color.parseColor("#536DFE");
static final int USER_COLOR_PINK = Color.parseColor("#FF4081");
private static final int USER_COLOR_YELLOW = Color.parseColor("#FFEB3B");
static final int USER_COLOR_YELLOW = Color.parseColor("#FFEB3B");
static final int USER_COLOR_WHITE = Color.WHITE;
/**
* Returns users currently viewing this topic.

Loading…
Cancel
Save