mirror of
https://github.com/sudoxnym/habitica-android.git
synced 2026-05-20 04:39:04 +00:00
mention community guidelines in chat
This commit is contained in:
parent
a9714ed053
commit
746f6860f9
4 changed files with 35 additions and 11 deletions
|
|
@ -3,13 +3,13 @@
|
|||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical">
|
||||
android:orientation="vertical"
|
||||
android:layout_margin="8dp">
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_margin="7dp"
|
||||
android:text="Chat"
|
||||
android:text="@string/chat"
|
||||
android:textAppearance="?android:attr/textAppearanceLarge"
|
||||
android:textColor="@color/material_drawer_primary_text" />
|
||||
|
||||
|
|
@ -20,17 +20,17 @@
|
|||
|
||||
<ImageButton
|
||||
android:id="@+id/emoji.toggle.btn"
|
||||
android:layout_width="50dp"
|
||||
android:layout_height="50dp"
|
||||
android:layout_width="30dp"
|
||||
android:layout_height="30dp"
|
||||
android:src="@drawable/ic_emoticon_grey600_24dp"
|
||||
android:scaleType="center"
|
||||
android:backgroundTint="@color/transparent"
|
||||
android:contentDescription="Toogle Emojis" />
|
||||
android:contentDescription="Toogle Emojis"
|
||||
android:layout_gravity="center"/>
|
||||
|
||||
<android.support.design.widget.TextInputLayout
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:minHeight="72dp"
|
||||
android:layout_weight="1"
|
||||
app:hintTextAppearance="@style/TextAppearance.AppCompat">
|
||||
|
||||
|
|
@ -51,7 +51,13 @@
|
|||
android:layout_height="50dp"
|
||||
android:textColor="@color/white"
|
||||
android:text="@string/post"
|
||||
android:drawableTint="@color/white"/>
|
||||
android:drawableTint="@color/white"
|
||||
android:layout_gravity="center"/>
|
||||
</LinearLayout>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/community_guidelines_view"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/read_community_guidelines"
|
||||
style="@style/Caption3" />
|
||||
</LinearLayout>
|
||||
|
|
|
|||
|
|
@ -564,4 +564,5 @@
|
|||
<string name="empty_description_todos">To-Dos are tasks that only need to be completed once. Add checklists to your To-Dos to increase their value.</string>
|
||||
<string name="empty_title_rewards">You don\'t have any Rewards</string>
|
||||
<string name="reset_walkthrough">Reset Justins Walkthrough</string>
|
||||
<string name="read_community_guidelines">Please read our Community Guidelines before posting</string>
|
||||
</resources>
|
||||
|
|
|
|||
|
|
@ -24,7 +24,10 @@ import net.pherth.android.emoji_library.EmojiTextView;
|
|||
import org.greenrobot.eventbus.EventBus;
|
||||
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.content.res.Resources;
|
||||
import android.graphics.Paint;
|
||||
import android.net.Uri;
|
||||
import android.support.annotation.Nullable;
|
||||
import android.support.v4.content.ContextCompat;
|
||||
import android.support.v7.app.AlertDialog;
|
||||
|
|
@ -181,6 +184,10 @@ public class ChatRecyclerViewAdapter extends RecyclerView.Adapter<ChatRecyclerVi
|
|||
@BindView(R.id.tvLikes)
|
||||
@Nullable
|
||||
TextView tvLikes;
|
||||
@BindView(R.id.community_guidelines_view)
|
||||
@Nullable
|
||||
TextView communityGuidelinesView;
|
||||
|
||||
Context context;
|
||||
Resources res;
|
||||
int likeCount = 0;
|
||||
|
|
@ -241,6 +248,15 @@ public class ChatRecyclerViewAdapter extends RecyclerView.Adapter<ChatRecyclerVi
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (communityGuidelinesView != null) {
|
||||
communityGuidelinesView.setPaintFlags(communityGuidelinesView.getPaintFlags() | Paint.UNDERLINE_TEXT_FLAG);
|
||||
communityGuidelinesView.setOnClickListener(v -> {
|
||||
Intent i = new Intent(Intent.ACTION_VIEW);
|
||||
i.setData(Uri.parse("https://habitica.com/static/community-guidelines"));
|
||||
context.startActivity(i);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
public void bind(final ChatMessage msg) {
|
||||
|
|
@ -316,8 +332,8 @@ public class ChatRecyclerViewAdapter extends RecyclerView.Adapter<ChatRecyclerVi
|
|||
tvLikes.setText("+" + likeCount);
|
||||
}
|
||||
|
||||
int backgroundColorRes = 0;
|
||||
int foregroundColorRes = 0;
|
||||
int backgroundColorRes;
|
||||
int foregroundColorRes;
|
||||
|
||||
if (likeCount != 0) {
|
||||
if (currentUserLikedPost) {
|
||||
|
|
|
|||
|
|
@ -36,6 +36,7 @@ import android.support.v7.widget.RecyclerView;
|
|||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.TextView;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
|
|
|
|||
Loading…
Reference in a new issue