From b52afc92947a412d3c87410bc7ac42e19bd9aa11 Mon Sep 17 00:00:00 2001 From: Rahmat Zulfikri Date: Sat, 19 Apr 2025 22:25:47 +0700 Subject: [PATCH 01/21] feat: move ui into lib --- app/src/main/AndroidManifest.xml | 19 +- .../photoediting/MainActivity.kt | 40 ++ app/src/main/res/layout/activity_main.xml | 17 + photoeditor/build.gradle | 9 + photoeditor/src/main/AndroidManifest.xml | 5 +- .../src/main/assets/beyond_wonderland.ttf | Bin 0 -> 176320 bytes .../src/main/assets/emojione-android.ttf | Bin 0 -> 3524972 bytes .../src/main/assets/filters/auto_fix.png | Bin 0 -> 159933 bytes photoeditor/src/main/assets/filters/b_n_w.png | Bin 0 -> 156451 bytes .../src/main/assets/filters/brightness.png | Bin 0 -> 139513 bytes .../src/main/assets/filters/contrast.png | Bin 0 -> 161797 bytes .../src/main/assets/filters/cross_process.png | Bin 0 -> 155569 bytes .../src/main/assets/filters/documentary.png | Bin 0 -> 70804 bytes .../src/main/assets/filters/dual_tone.png | Bin 0 -> 81206 bytes .../src/main/assets/filters/fill_light.png | Bin 0 -> 151907 bytes .../src/main/assets/filters/fish_eye.png | Bin 0 -> 166358 bytes .../main/assets/filters/flip_horizental.png | Bin 0 -> 159643 bytes .../src/main/assets/filters/flip_vertical.png | Bin 0 -> 159338 bytes photoeditor/src/main/assets/filters/grain.png | Bin 0 -> 159111 bytes .../src/main/assets/filters/gray_scale.png | Bin 0 -> 70235 bytes .../src/main/assets/filters/lomish.png | Bin 0 -> 153986 bytes .../src/main/assets/filters/negative.png | Bin 0 -> 159862 bytes .../src/main/assets/filters/original.jpg | Bin 0 -> 101064 bytes .../src/main/assets/filters/posterize.png | Bin 0 -> 103955 bytes .../src/main/assets/filters/rotate.png | Bin 0 -> 159537 bytes .../src/main/assets/filters/saturate.png | Bin 0 -> 160911 bytes photoeditor/src/main/assets/filters/sepia.png | Bin 0 -> 116352 bytes .../src/main/assets/filters/sharpen.png | Bin 0 -> 159816 bytes .../src/main/assets/filters/temprature.png | Bin 0 -> 163030 bytes photoeditor/src/main/assets/filters/tint.png | Bin 0 -> 83569 bytes .../src/main/assets/filters/vignette.png | Bin 0 -> 157496 bytes .../photoediting/ColorPickerAdapter.kt | 99 ++++ .../photoediting/EditImageActivity.kt | 528 ++++++++++++++++++ .../photoediting/EmojiBSFragment.kt | 164 ++++++ .../photoediting/FileSaveHelper.kt | 180 ++++++ .../photoediting/PropertiesBSFragment.kt | 71 +++ .../photoediting/ShapeBSFragment.kt | 100 ++++ .../photoediting/StickerBSFragment.kt | 117 ++++ .../photoediting/TextEditorDialogFragment.kt | 131 +++++ .../photoediting/base/BaseActivity.kt | 67 +++ .../photoediting/base/BaseFragment.kt | 10 + .../photoediting/filters/FilterListener.kt | 7 + .../photoediting/filters/FilterViewAdapter.kt | 97 ++++ .../photoediting/tools/EditingToolsAdapter.kt | 68 +++ .../photoediting/tools/ToolType.kt | 10 + .../drawable-v24/ic_launcher_foreground.xml | 34 ++ .../src/main/res/drawable/blank_image.jpg | Bin 0 -> 963 bytes .../src/main/res/drawable/ic_brush.xml | 9 + .../src/main/res/drawable/ic_camera.xml | 12 + .../src/main/res/drawable/ic_close.xml | 9 + .../src/main/res/drawable/ic_eraser.xml | 4 + .../src/main/res/drawable/ic_gallery.xml | 9 + .../main/res/drawable/ic_insert_emoticon.xml | 9 + .../res/drawable/ic_launcher_background.xml | 170 ++++++ photoeditor/src/main/res/drawable/ic_oval.xml | 9 + .../src/main/res/drawable/ic_photo_filter.xml | 5 + .../src/main/res/drawable/ic_rectangle.xml | 9 + photoeditor/src/main/res/drawable/ic_redo.xml | 9 + .../main/res/drawable/ic_redo_disabled.xml | 9 + photoeditor/src/main/res/drawable/ic_save.xml | 9 + .../src/main/res/drawable/ic_share.xml | 5 + .../src/main/res/drawable/ic_sticker.xml | 9 + photoeditor/src/main/res/drawable/ic_text.xml | 9 + photoeditor/src/main/res/drawable/ic_undo.xml | 9 + .../main/res/drawable/ic_undo_disabled.xml | 9 + .../src/main/res/drawable/original.jpg | Bin 0 -> 101064 bytes .../src/main/res/drawable/paris_tower.jpg | Bin 0 -> 97131 bytes photoeditor/src/main/res/drawable/redo.xml | 5 + .../res/drawable/rounded_border_text_view.xml | 14 + photoeditor/src/main/res/drawable/undo.xml | 5 + .../src/main/res/font/roboto_medium.xml | 7 + .../main/res/layout/activity_edit_image.xml | 142 +++++ .../src/main/res/layout/add_text_dialog.xml | 57 ++ .../res/layout/color_picker_item_list.xml | 15 + .../fragment_bottom_custom_effect_dialog.xml | 34 ++ .../fragment_bottom_properties_dialog.xml | 78 +++ .../layout/fragment_bottom_shapes_dialog.xml | 136 +++++ .../fragment_bottom_sticker_emoji_dialog.xml | 63 +++ .../src/main/res/layout/row_editing_tools.xml | 34 ++ photoeditor/src/main/res/layout/row_emoji.xml | 17 + .../src/main/res/layout/row_filter_view.xml | 35 ++ .../src/main/res/layout/row_sticker.xml | 23 + .../res/mipmap-anydpi-v26/ic_launcher.xml | 5 + .../mipmap-anydpi-v26/ic_launcher_round.xml | 5 + .../src/main/res/mipmap-hdpi/ic_launcher.png | Bin 0 -> 1874 bytes .../mipmap-hdpi/ic_launcher_foreground.png | Bin 0 -> 1815 bytes .../res/mipmap-hdpi/ic_launcher_round.png | Bin 0 -> 3863 bytes .../src/main/res/mipmap-mdpi/ic_launcher.png | Bin 0 -> 1251 bytes .../mipmap-mdpi/ic_launcher_foreground.png | Bin 0 -> 1176 bytes .../res/mipmap-mdpi/ic_launcher_round.png | Bin 0 -> 2413 bytes .../src/main/res/mipmap-xhdpi/ic_launcher.png | Bin 0 -> 2568 bytes .../mipmap-xhdpi/ic_launcher_foreground.png | Bin 0 -> 2493 bytes .../res/mipmap-xhdpi/ic_launcher_round.png | Bin 0 -> 5487 bytes .../main/res/mipmap-xxhdpi/ic_launcher.png | Bin 0 -> 3912 bytes .../mipmap-xxhdpi/ic_launcher_foreground.png | Bin 0 -> 3986 bytes .../res/mipmap-xxhdpi/ic_launcher_round.png | Bin 0 -> 8437 bytes .../main/res/mipmap-xxxhdpi/ic_launcher.png | Bin 0 -> 5371 bytes .../mipmap-xxxhdpi/ic_launcher_foreground.png | Bin 0 -> 5758 bytes .../res/mipmap-xxxhdpi/ic_launcher_round.png | Bin 0 -> 11997 bytes .../src/main/res/values-fr/strings.xml | 21 + .../src/main/res/values-pl/strings.xml | 21 + photoeditor/src/main/res/values/colors.xml | 22 + photoeditor/src/main/res/values/dimens.xml | 7 + .../src/main/res/values/font_certs.xml | 17 + .../res/values/ic_launcher_background.xml | 4 + .../src/main/res/values/preloaded_fonts.xml | 6 + photoeditor/src/main/res/values/strings.xml | 428 ++++++++++++++ photoeditor/src/main/res/values/styles.xml | 28 + photoeditor/src/main/res/xml/file_paths.xml | 8 + 109 files changed, 3311 insertions(+), 12 deletions(-) create mode 100644 app/src/main/java/com/burhanrashid52/photoediting/MainActivity.kt create mode 100644 app/src/main/res/layout/activity_main.xml create mode 100644 photoeditor/src/main/assets/beyond_wonderland.ttf create mode 100644 photoeditor/src/main/assets/emojione-android.ttf create mode 100644 photoeditor/src/main/assets/filters/auto_fix.png create mode 100644 photoeditor/src/main/assets/filters/b_n_w.png create mode 100644 photoeditor/src/main/assets/filters/brightness.png create mode 100644 photoeditor/src/main/assets/filters/contrast.png create mode 100644 photoeditor/src/main/assets/filters/cross_process.png create mode 100644 photoeditor/src/main/assets/filters/documentary.png create mode 100644 photoeditor/src/main/assets/filters/dual_tone.png create mode 100644 photoeditor/src/main/assets/filters/fill_light.png create mode 100644 photoeditor/src/main/assets/filters/fish_eye.png create mode 100644 photoeditor/src/main/assets/filters/flip_horizental.png create mode 100644 photoeditor/src/main/assets/filters/flip_vertical.png create mode 100644 photoeditor/src/main/assets/filters/grain.png create mode 100644 photoeditor/src/main/assets/filters/gray_scale.png create mode 100644 photoeditor/src/main/assets/filters/lomish.png create mode 100644 photoeditor/src/main/assets/filters/negative.png create mode 100644 photoeditor/src/main/assets/filters/original.jpg create mode 100644 photoeditor/src/main/assets/filters/posterize.png create mode 100644 photoeditor/src/main/assets/filters/rotate.png create mode 100644 photoeditor/src/main/assets/filters/saturate.png create mode 100644 photoeditor/src/main/assets/filters/sepia.png create mode 100644 photoeditor/src/main/assets/filters/sharpen.png create mode 100644 photoeditor/src/main/assets/filters/temprature.png create mode 100644 photoeditor/src/main/assets/filters/tint.png create mode 100644 photoeditor/src/main/assets/filters/vignette.png create mode 100644 photoeditor/src/main/java/ja/burhanrashid52/photoediting/ColorPickerAdapter.kt create mode 100644 photoeditor/src/main/java/ja/burhanrashid52/photoediting/EditImageActivity.kt create mode 100644 photoeditor/src/main/java/ja/burhanrashid52/photoediting/EmojiBSFragment.kt create mode 100644 photoeditor/src/main/java/ja/burhanrashid52/photoediting/FileSaveHelper.kt create mode 100644 photoeditor/src/main/java/ja/burhanrashid52/photoediting/PropertiesBSFragment.kt create mode 100644 photoeditor/src/main/java/ja/burhanrashid52/photoediting/ShapeBSFragment.kt create mode 100644 photoeditor/src/main/java/ja/burhanrashid52/photoediting/StickerBSFragment.kt create mode 100644 photoeditor/src/main/java/ja/burhanrashid52/photoediting/TextEditorDialogFragment.kt create mode 100644 photoeditor/src/main/java/ja/burhanrashid52/photoediting/base/BaseActivity.kt create mode 100644 photoeditor/src/main/java/ja/burhanrashid52/photoediting/base/BaseFragment.kt create mode 100644 photoeditor/src/main/java/ja/burhanrashid52/photoediting/filters/FilterListener.kt create mode 100644 photoeditor/src/main/java/ja/burhanrashid52/photoediting/filters/FilterViewAdapter.kt create mode 100644 photoeditor/src/main/java/ja/burhanrashid52/photoediting/tools/EditingToolsAdapter.kt create mode 100644 photoeditor/src/main/java/ja/burhanrashid52/photoediting/tools/ToolType.kt create mode 100644 photoeditor/src/main/res/drawable-v24/ic_launcher_foreground.xml create mode 100644 photoeditor/src/main/res/drawable/blank_image.jpg create mode 100644 photoeditor/src/main/res/drawable/ic_brush.xml create mode 100644 photoeditor/src/main/res/drawable/ic_camera.xml create mode 100644 photoeditor/src/main/res/drawable/ic_close.xml create mode 100644 photoeditor/src/main/res/drawable/ic_eraser.xml create mode 100644 photoeditor/src/main/res/drawable/ic_gallery.xml create mode 100644 photoeditor/src/main/res/drawable/ic_insert_emoticon.xml create mode 100644 photoeditor/src/main/res/drawable/ic_launcher_background.xml create mode 100644 photoeditor/src/main/res/drawable/ic_oval.xml create mode 100644 photoeditor/src/main/res/drawable/ic_photo_filter.xml create mode 100644 photoeditor/src/main/res/drawable/ic_rectangle.xml create mode 100644 photoeditor/src/main/res/drawable/ic_redo.xml create mode 100644 photoeditor/src/main/res/drawable/ic_redo_disabled.xml create mode 100644 photoeditor/src/main/res/drawable/ic_save.xml create mode 100644 photoeditor/src/main/res/drawable/ic_share.xml create mode 100644 photoeditor/src/main/res/drawable/ic_sticker.xml create mode 100644 photoeditor/src/main/res/drawable/ic_text.xml create mode 100644 photoeditor/src/main/res/drawable/ic_undo.xml create mode 100644 photoeditor/src/main/res/drawable/ic_undo_disabled.xml create mode 100644 photoeditor/src/main/res/drawable/original.jpg create mode 100644 photoeditor/src/main/res/drawable/paris_tower.jpg create mode 100644 photoeditor/src/main/res/drawable/redo.xml create mode 100644 photoeditor/src/main/res/drawable/rounded_border_text_view.xml create mode 100644 photoeditor/src/main/res/drawable/undo.xml create mode 100644 photoeditor/src/main/res/font/roboto_medium.xml create mode 100644 photoeditor/src/main/res/layout/activity_edit_image.xml create mode 100644 photoeditor/src/main/res/layout/add_text_dialog.xml create mode 100644 photoeditor/src/main/res/layout/color_picker_item_list.xml create mode 100644 photoeditor/src/main/res/layout/fragment_bottom_custom_effect_dialog.xml create mode 100644 photoeditor/src/main/res/layout/fragment_bottom_properties_dialog.xml create mode 100644 photoeditor/src/main/res/layout/fragment_bottom_shapes_dialog.xml create mode 100644 photoeditor/src/main/res/layout/fragment_bottom_sticker_emoji_dialog.xml create mode 100644 photoeditor/src/main/res/layout/row_editing_tools.xml create mode 100644 photoeditor/src/main/res/layout/row_emoji.xml create mode 100644 photoeditor/src/main/res/layout/row_filter_view.xml create mode 100644 photoeditor/src/main/res/layout/row_sticker.xml create mode 100644 photoeditor/src/main/res/mipmap-anydpi-v26/ic_launcher.xml create mode 100644 photoeditor/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml create mode 100644 photoeditor/src/main/res/mipmap-hdpi/ic_launcher.png create mode 100644 photoeditor/src/main/res/mipmap-hdpi/ic_launcher_foreground.png create mode 100644 photoeditor/src/main/res/mipmap-hdpi/ic_launcher_round.png create mode 100644 photoeditor/src/main/res/mipmap-mdpi/ic_launcher.png create mode 100644 photoeditor/src/main/res/mipmap-mdpi/ic_launcher_foreground.png create mode 100644 photoeditor/src/main/res/mipmap-mdpi/ic_launcher_round.png create mode 100644 photoeditor/src/main/res/mipmap-xhdpi/ic_launcher.png create mode 100644 photoeditor/src/main/res/mipmap-xhdpi/ic_launcher_foreground.png create mode 100644 photoeditor/src/main/res/mipmap-xhdpi/ic_launcher_round.png create mode 100644 photoeditor/src/main/res/mipmap-xxhdpi/ic_launcher.png create mode 100644 photoeditor/src/main/res/mipmap-xxhdpi/ic_launcher_foreground.png create mode 100644 photoeditor/src/main/res/mipmap-xxhdpi/ic_launcher_round.png create mode 100644 photoeditor/src/main/res/mipmap-xxxhdpi/ic_launcher.png create mode 100644 photoeditor/src/main/res/mipmap-xxxhdpi/ic_launcher_foreground.png create mode 100644 photoeditor/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png create mode 100644 photoeditor/src/main/res/values-fr/strings.xml create mode 100644 photoeditor/src/main/res/values-pl/strings.xml create mode 100644 photoeditor/src/main/res/values/colors.xml create mode 100644 photoeditor/src/main/res/values/dimens.xml create mode 100644 photoeditor/src/main/res/values/font_certs.xml create mode 100644 photoeditor/src/main/res/values/ic_launcher_background.xml create mode 100644 photoeditor/src/main/res/values/preloaded_fonts.xml create mode 100644 photoeditor/src/main/res/values/strings.xml create mode 100644 photoeditor/src/main/res/values/styles.xml create mode 100644 photoeditor/src/main/res/xml/file_paths.xml diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index f99a8bad..0d6d569e 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -8,7 +8,7 @@ @@ -30,29 +29,30 @@ - + + - + + - + + - - - - - \ No newline at end of file diff --git a/app/src/main/java/com/burhanrashid52/photoediting/MainActivity.kt b/app/src/main/java/com/burhanrashid52/photoediting/MainActivity.kt new file mode 100644 index 00000000..144ecea7 --- /dev/null +++ b/app/src/main/java/com/burhanrashid52/photoediting/MainActivity.kt @@ -0,0 +1,40 @@ +package com.burhanrashid52.photoediting + +import android.content.Intent +import android.os.Bundle +import android.widget.Button +import androidx.activity.enableEdgeToEdge +import androidx.appcompat.app.AppCompatActivity +import androidx.core.view.ViewCompat +import androidx.core.view.WindowInsetsCompat +import ja.burhanrashid52.photoediting.EditImageActivity + +class MainActivity : AppCompatActivity() { + override fun onCreate(savedInstanceState: Bundle?) { + super.onCreate(savedInstanceState) + enableEdgeToEdge() + setContentView(R.layout.activity_main) + ViewCompat.setOnApplyWindowInsetsListener(findViewById(R.id.main)) { v, insets -> + val systemBars = insets.getInsets(WindowInsetsCompat.Type.systemBars()) + v.setPadding(systemBars.left, systemBars.top, systemBars.right, systemBars.bottom) + insets + } + + findViewById