Skip to content

Commit

Permalink
Merge branch 'develop' into feat-bottom-navigation
Browse files Browse the repository at this point in the history
# Conflicts:
#	app/src/main/AndroidManifest.xml
  • Loading branch information
jihyunniiii committed Jan 3, 2024
2 parents 219b6a4 + abe3c2c commit 11a9493
Show file tree
Hide file tree
Showing 7 changed files with 130 additions and 1 deletion.
7 changes: 6 additions & 1 deletion app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,12 @@
</intent-filter>
</activity>

<activity
android:name=".presentation.ui.dummy.DummyCustomDEditTextActivity"
android:exported="false"
android:screenOrientation="portrait"
tools:ignore="LockedOrientationActivity"/>

<activity
android:name=".presentation.ui.main.MainActivity"
android:exported="false"
Expand Down Expand Up @@ -60,5 +66,4 @@
android:name="io.sentry.traces.profiling.sample-rate"
android:value="1.0" />
</application>

</manifest>
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
package org.sopt.pingle.presentation.ui.dummy

import android.os.Bundle
import org.sopt.pingle.R
import org.sopt.pingle.databinding.ActivityEditTextCustomTestBinding
import org.sopt.pingle.util.base.BindingActivity

class DummyCustomDEditTextActivity : BindingActivity<ActivityEditTextCustomTestBinding>(R.layout.activity_edit_text_custom_test) {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
}
}
38 changes: 38 additions & 0 deletions app/src/main/java/org/sopt/pingle/util/component/PingleEditText.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
package org.sopt.pingle.util.component

import android.annotation.SuppressLint
import android.content.Context
import android.content.res.TypedArray
import android.util.AttributeSet
import android.view.LayoutInflater
import androidx.constraintlayout.widget.ConstraintLayout
import org.sopt.pingle.R
import org.sopt.pingle.databinding.EditTextPingleBinding

@SuppressLint("CustomViewStyleable")
class PingleEditText(
context: Context,
attrs: AttributeSet
) : ConstraintLayout(context, attrs) {
private lateinit var binding: EditTextPingleBinding

init {
val typedArray = context.obtainStyledAttributes(attrs, R.styleable.pingleEditText)
try {
initView(typedArray)
} finally {
typedArray.recycle()
}
}

private fun initView(typedArray: TypedArray) {
binding = EditTextPingleBinding.inflate(LayoutInflater.from(context), this, true)
typedArray.apply {
val title = getString(R.styleable.pingleEditText_title)
binding.tvTitle.text = title

val hint = getString(R.styleable.pingleEditText_hint)
binding.etEditText.hint = hint
}
}
}
5 changes: 5 additions & 0 deletions app/src/main/res/drawable/cursor_drawble.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<size android:width="1dp" />
<solid android:color="@color/pingle_green" />
</shape>
23 changes: 23 additions & 0 deletions app/src/main/res/layout/activity_edit_text_custom_test.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
<?xml version="1.0" encoding="utf-8"?>
<layout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto">

<data>

</data>

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

<org.sopt.pingle.util.component.PingleEditText
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginHorizontal="@dimen/spacing16"
app:hint="힌트얌"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:title="레이블" />
</androidx.constraintlayout.widget.ConstraintLayout>
</layout>
39 changes: 39 additions & 0 deletions app/src/main/res/layout/edit_text_pingle.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@drawable/shape_border_radius_12"
android:backgroundTint="@color/g_10"
android:paddingHorizontal="@dimen/spacing18"
android:paddingVertical="@dimen/spacing16">

<TextView
android:id="@+id/tv_title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textAppearance="@style/TextAppearance.Pingle.Cap.Semi.12"
android:textColor="@color/g_03"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
tools:text="제목" />

<EditText
android:id="@+id/et_edit_text"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginTop="4dp"
android:background="@null"
android:imeOptions="actionDone"
android:inputType="text"
android:maxLines="1"
android:textAppearance="@style/TextAppearance.Pingle.Sub.Semi.16"
android:textColor="@color/white"
android:textColorHint="@color/g_07"
android:textCursorDrawable="@drawable/cursor_drawble"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/tv_title"
tools:text="에딧텍스트 내용" />
</androidx.constraintlayout.widget.ConstraintLayout>
7 changes: 7 additions & 0 deletions app/src/main/res/values/attrs.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<declare-styleable name="pingleEditText">
<attr name="title" format="reference|string"/>
<attr name="hint" format="reference|string"/>
</declare-styleable>
</resources>

0 comments on commit 11a9493

Please sign in to comment.