Skip to content

Commit

Permalink
[Design/#10] qna 커스텀 appbar 구현
Browse files Browse the repository at this point in the history
  • Loading branch information
ss99x2002 committed Jul 6, 2023
1 parent 8c900e9 commit d3c8f7f
Show file tree
Hide file tree
Showing 5 changed files with 98 additions and 1 deletion.
9 changes: 9 additions & 0 deletions app/src/main/res/drawable/ic_check.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24"
android:viewportHeight="24">
<path
android:pathData="M8.795,15.875L4.625,11.705L3.205,13.115L8.795,18.705L20.795,6.705L19.385,5.295L8.795,15.875Z"
android:fillColor="#575757"/>
</vector>
6 changes: 6 additions & 0 deletions app/src/main/res/drawable/shape_grey_appbar_r68_rect.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<corners android:radius="68dp" />
<solid android:color="@color/grey_999999" />
</shape>
7 changes: 7 additions & 0 deletions app/src/main/res/layout/activity_answer.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent">


</androidx.constraintlayout.widget.ConstraintLayout>
2 changes: 1 addition & 1 deletion app/src/main/res/layout/basic_appbar.xml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@

<TextView
android:id="@+id/tv_appbar_title"
style="@style/AndroidBody2Regular16"
style="@style/AndroidBody2_2Regular16"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@{titleText == null ? null : titleText}"
Expand Down
75 changes: 75 additions & 0 deletions app/src/main/res/layout/qna_appbar.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
<?xml version="1.0" encoding="utf-8"?>
<layout xmlns:tools="http://schemas.android.com/tools">

<data>
<import type="android.view.View"/>
<variable
name="titleText"
type="String" />
<variable
name="visibleCheck"
type="java.lang.Boolean"/>
</data>

<com.google.android.material.appbar.AppBarLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="60dp">

<androidx.appcompat.widget.Toolbar
style="@style/toolbar"
android:layout_height="60dp"
app:popupTheme="@style/ThemeOverlay.AppCompat.Light">

<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="match_parent">

<ImageView
android:id="@+id/iv_back"
android:layout_width="24dp"
android:layout_height="24dp"
android:layout_marginStart="16dp"
android:src="@drawable/ic_arrow_back"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />

<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="160dp"
android:layout_height="32dp"
android:background="@drawable/shape_grey_appbar_r68_rect"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent">

<TextView
android:id="@+id/tv_appbar_title"
style="@style/BrandTypeSmallSemiBold16"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@{titleText == null ? null : titleText}"
android:textColor="@color/black"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
tools:text="#1 어린시절" />

</androidx.constraintlayout.widget.ConstraintLayout>

<ImageView
android:id="@+id/iv_check"
android:layout_width="24dp"
android:layout_height="24dp"
android:layout_marginEnd="16dp"
android:src="@drawable/ic_check"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
android:visibility="@{visibleCheck ? View.GONE : View.VISIBLE}"
app:layout_constraintTop_toTopOf="parent" />
</androidx.constraintlayout.widget.ConstraintLayout>
</androidx.appcompat.widget.Toolbar>
</com.google.android.material.appbar.AppBarLayout>
</layout>

0 comments on commit d3c8f7f

Please sign in to comment.