Skip to content

Commit

Permalink
UI Adjustment for EmojiDialog
Browse files Browse the repository at this point in the history
  • Loading branch information
mohsin363 committed May 23, 2022
1 parent a63c826 commit 732e4de
Show file tree
Hide file tree
Showing 10 changed files with 29 additions and 50 deletions.
4 changes: 2 additions & 2 deletions .idea/deploymentTargetDropDown.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 3 additions & 1 deletion .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 4 additions & 3 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,8 @@ dependencies {
androidTestImplementation 'androidx.test.ext:junit:1.1.3'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0'

implementation("androidx.emoji:emoji:1.1.0")
implementation("androidx.emoji:emoji-appcompat:1.1.0")
implementation("androidx.emoji:emoji-bundled:1.1.0")
def emojiVersion = "1.2.0-alpha03"
implementation("androidx.emoji:emoji:$emojiVersion")
implementation("androidx.emoji:emoji-appcompat:$emojiVersion")
implementation("androidx.emoji:emoji-bundled:$emojiVersion")
}
3 changes: 2 additions & 1 deletion app/src/main/res/layout/activity_main.xml
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,10 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="256dp"
android:textSize="28sp"
android:textAppearance="@style/EmojiBottomSheet.TextAppearance.Body1"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.498"
app:layout_constraintHorizontal_bias="0.5"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
tools:text="\uD83C\uDF44" />
Expand Down
7 changes: 4 additions & 3 deletions emojidialog/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,8 @@ dependencies {
androidTestImplementation 'androidx.test.ext:junit:1.1.3'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0'

implementation("androidx.emoji:emoji:1.1.0")
implementation("androidx.emoji:emoji-appcompat:1.1.0")
implementation("androidx.emoji:emoji-bundled:1.1.0")
def emojiVersion = "1.2.0-alpha03"
implementation("androidx.emoji:emoji:$emojiVersion")
implementation("androidx.emoji:emoji-appcompat:$emojiVersion")
implementation("androidx.emoji:emoji-bundled:$emojiVersion")
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,17 @@ import com.haider.emojidialog.view.recyclerview.EmojiItemView

class EmojiCategoryTransformer {

fun transform(category: Category): List<com.haider.emojidialog.view.recyclerview.EmojiItemView> = transformCategoryToEmojiItems(category).filter {
com.haider.emojidialog.emoji.EmojiCompatUtils.hasEmojiGlyph(it.unicode)
// true
fun transform(category: Category): List<EmojiItemView> = transformCategoryToEmojiItems(category).filter {
// EmojiCompatUtils.hasEmojiGlyph(it.unicode)
true
}

private fun transformCategoryToEmojiItems(category: Category): List<com.haider.emojidialog.view.recyclerview.EmojiItemView> {
val list: MutableList<com.haider.emojidialog.view.recyclerview.EmojiItemView> = mutableListOf()
private fun transformCategoryToEmojiItems(category: Category): List<EmojiItemView> {
val list: MutableList<EmojiItemView> = mutableListOf()

list.apply {
category.categoryUnicode.forEach {
list.add(com.haider.emojidialog.view.recyclerview.EmojiItemView.createEmojiViewItem(it.unicode, it.name))
list.add(EmojiItemView.createEmojiViewItem(it.unicode, it.name))
}
}

Expand Down
33 changes: 3 additions & 30 deletions emojidialog/src/main/res/layout/fragment_emoji.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout 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:id="@+id/ll_emoji_category_view_container"
android:layout_width="match_parent"
Expand All @@ -11,34 +10,8 @@
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/recyclerViewEmojis"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:padding="@dimen/dim_16"
android:layout_height="230dp"
android:padding="@dimen/dim_8"
tools:listitem="@layout/row_emoji" />

</LinearLayout>

<!--<?xml version="1.0" encoding="utf-8"?>-->
<!--<androidx.core.widget.NestedScrollView 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:id="@+id/view_help_bottom_sheet"-->
<!-- android:layout_width="match_parent"-->
<!-- android:layout_height="wrap_content"-->
<!-- android:background="@color/white">-->

<!-- <LinearLayout-->
<!-- android:id="@+id/ll_emoji_category_view_container"-->
<!-- android:layout_width="match_parent"-->
<!-- android:layout_height="wrap_content"-->
<!-- android:orientation="vertical"-->
<!-- app:layout_behavior="android.support.design.widget.BottomSheetBehavior">-->

<!-- <androidx.recyclerview.widget.RecyclerView-->
<!-- android:id="@+id/recyclerViewEmojis"-->
<!-- android:layout_width="match_parent"-->
<!-- android:layout_height="wrap_content"-->
<!-- android:padding="@dimen/dim_16"-->
<!-- tools:listitem="@layout/row_emoji" />-->

<!-- </LinearLayout>-->
<!--</androidx.core.widget.NestedScrollView>-->
</LinearLayout>
5 changes: 3 additions & 2 deletions emojidialog/src/main/res/layout/row_emoji.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@
android:id="@+id/etv_emoji"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingBottom="@dimen/dim_16"
android:layout_margin="4dp"
android:paddingBottom="@dimen/dim_8"
android:textColor="@color/colorPrimary"
android:textSize="@dimen/emoji_size"
android:textSize="28sp"
tools:text="\uD83C\uDF44" />
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
android:id="@+id/emoji_titles_tab"
android:layout_width="match_parent"
android:layout_height="?android:actionBarSize"
app:tabMode="scrollable"
app:tabMode="fixed"
android:background="@color/background_color"
app:tabTextAppearance="@android:style/TextAppearance.Widget.TabWidget"
app:tabIndicatorColor="@color/tab_indicator_color"
Expand Down
2 changes: 1 addition & 1 deletion emojidialog/src/main/res/values/dimens.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<dimen name="dim_25">25dp</dimen>
<dimen name="dim_40">40dp</dimen>

<dimen name="emoji_size">20sp</dimen>
<dimen name="emoji_size">28sp</dimen>
<dimen name="text_plain">14sp</dimen>
<dimen name="text_h1_size">96sp</dimen>
<dimen name="text_h2_size">64sp</dimen>
Expand Down

0 comments on commit 732e4de

Please sign in to comment.