mirror of
https://github.com/sudoxnym/habitica-android.git
synced 2026-05-22 05:38:55 +00:00
new speechbubble style for tutorial views
This commit is contained in:
parent
d9360d9e0d
commit
b1d58fb1af
10 changed files with 67 additions and 76 deletions
BIN
Habitica/res/drawable-hdpi/justin_textbox.png
Normal file
BIN
Habitica/res/drawable-hdpi/justin_textbox.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 18 KiB |
BIN
Habitica/res/drawable-mdpi/justin_textbox.png
Normal file
BIN
Habitica/res/drawable-mdpi/justin_textbox.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 18 KiB |
BIN
Habitica/res/drawable-xhdpi/justin_textbox.png
Normal file
BIN
Habitica/res/drawable-xhdpi/justin_textbox.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 18 KiB |
BIN
Habitica/res/drawable-xxhdpi/justin_textbox.png
Normal file
BIN
Habitica/res/drawable-xxhdpi/justin_textbox.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 18 KiB |
|
|
@ -49,7 +49,7 @@
|
|||
android:layout_height="wrap_content"
|
||||
app:namePlate="Justin"
|
||||
app:text="@string/avatar_setup_description"
|
||||
app:npcDrawable="@drawable/npc_justin_only"
|
||||
app:npcDrawable="@drawable/justin_textbox"
|
||||
android:layout_marginLeft="@dimen/content_inset"
|
||||
android:layout_marginRight="@dimen/content_inset"
|
||||
android:layout_above="@id/customization_drawer"
|
||||
|
|
|
|||
|
|
@ -47,7 +47,7 @@
|
|||
android:layout_height="wrap_content"
|
||||
app:namePlate="Justin"
|
||||
app:text="@string/task_setup_description"
|
||||
app:npcDrawable="@drawable/npc_justin_only"
|
||||
app:npcDrawable="@drawable/justin_textbox"
|
||||
android:layout_marginLeft="@dimen/content_inset"
|
||||
android:layout_marginRight="@dimen/content_inset"
|
||||
android:layout_above="@id/recyclerView"
|
||||
|
|
|
|||
|
|
@ -2,6 +2,7 @@
|
|||
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_width="match_parent"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:clickable="true"
|
||||
android:fitsSystemWindows="true"
|
||||
android:id="@+id/background">
|
||||
|
|
@ -9,70 +10,17 @@
|
|||
android:layout_width="match_parent"
|
||||
android:background="@android:color/black"
|
||||
android:alpha="0.6"/>
|
||||
<LinearLayout
|
||||
android:orientation="horizontal" android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
|
||||
<ImageView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:id="@+id/imageView8"
|
||||
android:src="@drawable/npc_justin_only"
|
||||
android:layout_gravity="bottom"
|
||||
android:layout_marginLeft="8dp"
|
||||
android:layout_marginStart="8dp"/>
|
||||
|
||||
<LinearLayout
|
||||
android:orientation="vertical"
|
||||
<FrameLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:padding="16dp"
|
||||
android:layout_alignParentBottom="true"
|
||||
android:fitsSystemWindows="true"
|
||||
android:layout_marginBottom="?actionBarSize">
|
||||
<com.habitrpg.android.habitica.ui.SpeechBubbleView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@drawable/speech_bubble"
|
||||
android:layout_gravity="bottom"
|
||||
android:layout_marginLeft="6dp"
|
||||
android:layout_marginStart="6dp"
|
||||
android:layout_marginRight="12dp"
|
||||
android:layout_marginEnd="12dp"
|
||||
android:layout_marginBottom="24dp"
|
||||
android:paddingBottom="24dp"
|
||||
android:paddingLeft="10dp"
|
||||
android:paddingTop="12dp"
|
||||
android:paddingRight="10dp">
|
||||
|
||||
<TextView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:id="@+id/tutorialTextView"
|
||||
android:layout_gravity="bottom"
|
||||
android:textSize="20sp" />
|
||||
|
||||
<LinearLayout
|
||||
android:orientation="horizontal"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
style="?android:attr/buttonBarStyle" >
|
||||
|
||||
<Button
|
||||
android:layout_width="0px"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:text="@string/dismiss_tutorial"
|
||||
android:id="@+id/dismissButton"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:theme="@style/DialogButton"
|
||||
style="?android:attr/buttonBarButtonStyle" />
|
||||
|
||||
<Button
|
||||
android:layout_width="0px"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:text="@string/complete_tutorial"
|
||||
android:id="@+id/completeButton"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:theme="@style/DialogButton"
|
||||
style="?android:attr/buttonBarButtonStyle" />
|
||||
</LinearLayout>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</LinearLayout>
|
||||
app:namePlate="Justin"
|
||||
app:npcDrawable="@drawable/justin_textbox"/>
|
||||
</FrameLayout>
|
||||
</RelativeLayout>
|
||||
|
|
|
|||
|
|
@ -9,12 +9,11 @@
|
|||
android:id="@+id/npc_image_view"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
tools:src="@drawable/npc_justin_only"
|
||||
tools:src="@drawable/justin_textbox"
|
||||
android:layout_gravity="right"
|
||||
android:layout_marginRight="30dp"/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/textView"
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@drawable/white_rounded_bg"
|
||||
|
|
@ -22,9 +21,44 @@
|
|||
android:paddingTop="16dp"
|
||||
android:paddingRight="21dp"
|
||||
android:paddingBottom="14dp"
|
||||
android:layout_marginTop="74dp"
|
||||
style="@style/Body1"
|
||||
tools:text="@string/welcome_text"/>
|
||||
android:layout_marginTop="56dp"
|
||||
android:orientation="vertical">
|
||||
<TextView
|
||||
android:id="@+id/textView"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
|
||||
style="@style/Body1"
|
||||
tools:text="@string/welcome_text"/>
|
||||
<LinearLayout
|
||||
android:id="@+id/confirmation_buttons"
|
||||
android:orientation="horizontal"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
style="?android:attr/buttonBarStyle" >
|
||||
|
||||
<Button
|
||||
android:layout_width="0px"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:text="@string/dismiss_tutorial"
|
||||
android:id="@+id/dismissButton"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:theme="@style/DialogButton"
|
||||
style="?android:attr/buttonBarButtonStyle" />
|
||||
|
||||
<Button
|
||||
android:layout_width="0px"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:text="@string/complete_tutorial"
|
||||
android:id="@+id/completeButton"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:theme="@style/DialogButton"
|
||||
style="?android:attr/buttonBarButtonStyle" />
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/name_plate"
|
||||
android:layout_width="wrap_content"
|
||||
|
|
@ -34,6 +68,6 @@
|
|||
android:gravity="center_vertical"
|
||||
android:textColor="@color/white"
|
||||
android:layout_marginLeft="21dp"
|
||||
android:layout_marginTop="60dp"
|
||||
android:layout_marginTop="42dp"
|
||||
android:textStyle="bold" />
|
||||
</FrameLayout>
|
||||
|
|
@ -7,6 +7,8 @@ import android.content.Context;
|
|||
import android.content.res.TypedArray;
|
||||
import android.graphics.drawable.Drawable;
|
||||
import android.util.AttributeSet;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.FrameLayout;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.TextView;
|
||||
|
|
@ -25,6 +27,9 @@ public class SpeechBubbleView extends FrameLayout {
|
|||
@BindView(R.id.npc_image_view)
|
||||
ImageView npcImageView;
|
||||
|
||||
@BindView(R.id.confirmation_buttons)
|
||||
ViewGroup confirmationButtons;
|
||||
|
||||
public SpeechBubbleView(Context context, AttributeSet attrs) {
|
||||
super(context, attrs);
|
||||
|
||||
|
|
@ -44,6 +49,8 @@ public class SpeechBubbleView extends FrameLayout {
|
|||
if (iconRes != null) {
|
||||
npcImageView.setImageDrawable(iconRes);
|
||||
}
|
||||
|
||||
confirmationButtons.setVisibility(View.GONE);
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -11,6 +11,8 @@ import android.widget.FrameLayout;
|
|||
import android.widget.RelativeLayout;
|
||||
import android.widget.TextView;
|
||||
|
||||
import java.util.Objects;
|
||||
|
||||
import butterknife.BindView;
|
||||
import butterknife.ButterKnife;
|
||||
|
||||
|
|
@ -18,7 +20,7 @@ public class TutorialView extends FrameLayout implements View.OnClickListener {
|
|||
|
||||
public TutorialStep step;
|
||||
public OnTutorialReaction onReaction;
|
||||
@BindView(R.id.tutorialTextView)
|
||||
@BindView(R.id.textView)
|
||||
TextView tutorialTextView;
|
||||
@BindView(R.id.background)
|
||||
RelativeLayout background;
|
||||
|
|
@ -45,9 +47,9 @@ public class TutorialView extends FrameLayout implements View.OnClickListener {
|
|||
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
if (v == background || v == completeButton) {
|
||||
if (Objects.equals(v, background) || Objects.equals(v, completeButton)) {
|
||||
this.onReaction.onTutorialCompleted(this.step);
|
||||
} else if (v == dismissButton) {
|
||||
} else if (Objects.equals(v, dismissButton)) {
|
||||
this.onReaction.onTutorialDeferred(this.step);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue