├── .gitignore ├── PULL_REQUEST_TEMPLATE ├── README.md ├── build.gradle.kts ├── buildSrc ├── .gitignore ├── build.gradle.kts ├── settings.gradle.kts └── src │ └── main │ └── kotlin │ ├── Configs.kt │ ├── Dependencies.kt │ ├── Plugins.kt │ └── publish.gradle.kts ├── gradle.properties ├── gradle └── wrapper │ ├── gradle-wrapper.jar │ └── gradle-wrapper.properties ├── gradlew ├── gradlew.bat ├── images ├── card-input-view-1.png ├── card-input-view-2.png ├── dialogs-1.png ├── dialogs-2.png ├── dialogs-3.png ├── dialogs-4.png ├── dialogs-5.png ├── fitoptionmessageview.png ├── logo.png ├── quantity-picker-compose.gif ├── quantity-picker-view-1.gif ├── rating-bar-1.png ├── suggestion-input-view-1.gif ├── timeline-view-compose-horizontal-animated.gif ├── timeline-view-compose-horizontal.png ├── timeline-view-compose-vertical-animated.gif ├── timeline-view-compose-vertical.gif ├── timeline-view.png ├── toolbar-1.png ├── uic1.png ├── uic2.png ├── uic3.png ├── uic4.png └── uic5.png ├── libraries ├── card-input-view │ ├── .gitignore │ ├── README.md │ ├── build.gradle.kts │ ├── consumer-rules.pro │ ├── proguard-rules.pro │ └── src │ │ └── main │ │ ├── java │ │ └── com │ │ │ └── trendyol │ │ │ └── cardinputview │ │ │ ├── CardInformation.kt │ │ │ ├── CardInputView.kt │ │ │ ├── CardInputViewState.kt │ │ │ ├── CreditCardType.kt │ │ │ ├── Extensions.kt │ │ │ ├── formatter │ │ │ ├── CardNumberFormatterTextWatcher.kt │ │ │ └── CreditCardMasker.kt │ │ │ └── validator │ │ │ ├── CreditCardValidator.kt │ │ │ └── LuhnValidator.kt │ │ └── res │ │ ├── drawable │ │ ├── ic_card_input_down_arrow.xml │ │ ├── shape_card_input_cvv_info_background.xml │ │ ├── shape_card_input_field_background.xml │ │ └── shape_card_input_field_error_background.xml │ │ ├── layout │ │ └── view_card_input.xml │ │ └── values │ │ ├── attrs.xml │ │ ├── colors.xml │ │ ├── dimens.xml │ │ └── strings.xml ├── dialogs │ ├── .gitignore │ ├── README.md │ ├── build.gradle.kts │ ├── consumer-rules.pro │ ├── proguard-rules.pro │ └── src │ │ └── main │ │ ├── java │ │ └── com │ │ │ └── trendyol │ │ │ └── uicomponents │ │ │ └── dialogs │ │ │ ├── BaseBottomSheetDialog.kt │ │ │ ├── Builder.kt │ │ │ ├── BuilderExtensions.kt │ │ │ ├── DialogFragment.kt │ │ │ ├── DialogFragmentArguments.kt │ │ │ ├── DialogViewState.kt │ │ │ ├── Extensions.kt │ │ │ ├── ItemDivider.kt │ │ │ ├── SingleLiveEvent.kt │ │ │ ├── TextPosition.kt │ │ │ ├── WebViewContent.kt │ │ │ ├── configurator │ │ │ ├── WebViewConfigurator.kt │ │ │ └── WebViewDownloadConfigurator.kt │ │ │ └── list │ │ │ ├── DialogListAdapter.kt │ │ │ ├── DialogListItemViewState.kt │ │ │ ├── DialogListViewModel.kt │ │ │ ├── ItemDecorator.kt │ │ │ ├── ListItemDiffCallback.kt │ │ │ └── info │ │ │ ├── DialogInfoListAdapter.kt │ │ │ ├── DialogInfoListItemViewState.kt │ │ │ └── InfoListItemDiffCallback.kt │ │ └── res │ │ ├── drawable │ │ ├── ic_ui_components_dialogs_close.xml │ │ ├── ic_ui_components_dialogs_radio_button_checked.xml │ │ ├── ic_ui_components_dialogs_radio_button_unchecked.xml │ │ └── selector_ui_components_dialogs_radio_button.xml │ │ ├── layout │ │ ├── fragment_dialog.xml │ │ ├── item_ui_components_info_list_dialog.xml │ │ ├── item_ui_components_selection_dialog.xml │ │ └── layout_dialog_header.xml │ │ └── values │ │ ├── colors.xml │ │ ├── dimens.xml │ │ ├── strings.xml │ │ └── styles.xml ├── fit-option-message-view │ ├── .gitignore │ ├── build.gradle.kts │ ├── consumer-rules.pro │ ├── proguard-rules.pro │ └── src │ │ └── main │ │ ├── java │ │ └── com │ │ │ └── trendyol │ │ │ └── fitoptionmessageview │ │ │ └── FitOptionMessageView.kt │ │ └── res │ │ └── values │ │ └── attrs.xml ├── image-slider │ ├── .gitignore │ ├── build.gradle.kts │ ├── consumer-rules.pro │ ├── proguard-rules.pro │ └── src │ │ └── main │ │ ├── java │ │ └── com │ │ │ └── trendyol │ │ │ └── uicomponents │ │ │ └── imageslider │ │ │ ├── CVFloatingZoomView.kt │ │ │ ├── Extensions.kt │ │ │ ├── HackyViewPager.kt │ │ │ ├── ImageSlider.kt │ │ │ ├── ImageSliderView.kt │ │ │ ├── ImageSliderViewState.kt │ │ │ ├── ImagesPagerAdapter.kt │ │ │ └── touchdelegator │ │ │ └── ZoomWindowTouchListener.kt │ │ └── res │ │ ├── animator │ │ └── animator_alpha.xml │ │ ├── drawable │ │ ├── background_indicator.xml │ │ ├── shape_indicator_selected.xml │ │ └── shape_indicator_unselected.xml │ │ ├── layout │ │ ├── view_image.xml │ │ └── view_image_slider.xml │ │ └── values │ │ ├── colors.xml │ │ └── dimens.xml ├── phonenumber │ ├── build.gradle.kts │ ├── consumer-rules.pro │ ├── proguard-rules.pro │ └── src │ │ └── main │ │ └── java │ │ └── com │ │ └── trendyol │ │ └── uicomponents │ │ └── phonenumber │ │ ├── PhoneNumberTextInputEditText.kt │ │ └── PhoneNumberTextInputEditTextViewState.kt ├── quantity-picker-compose │ ├── .gitignore │ ├── README.md │ ├── build.gradle.kts │ ├── consumer-rules.pro │ ├── proguard-rules.pro │ └── src │ │ └── main │ │ ├── AndroidManifest.xml │ │ ├── java │ │ └── com │ │ │ └── trendyol │ │ │ └── uicomponents │ │ │ └── quantitypicker │ │ │ ├── QuantityAddIcon.kt │ │ │ ├── QuantityIcons.kt │ │ │ ├── QuantityPicker.kt │ │ │ ├── QuantityPickerDefaults.kt │ │ │ ├── QuantityPickerDirection.kt │ │ │ ├── QuantityPickerViewData.kt │ │ │ ├── QuantityShape.kt │ │ │ ├── QuantitySubtractIcon.kt │ │ │ └── QuantityText.kt │ │ └── res │ │ └── drawable │ │ ├── ic_plus.xml │ │ ├── ic_subtract.xml │ │ └── ic_trash.xml ├── quantity-picker-view │ ├── .gitignore │ ├── README.md │ ├── build.gradle.kts │ ├── consumer-rules.pro │ ├── proguard-rules.pro │ └── src │ │ └── main │ │ ├── java │ │ └── com │ │ │ └── trendyol │ │ │ └── uicomponents │ │ │ └── quantitypickerview │ │ │ ├── BindingAdapters.kt │ │ │ ├── Extensions.kt │ │ │ ├── QuantityPickerTextAppearance.kt │ │ │ ├── QuantityPickerView.kt │ │ │ └── QuantityPickerViewState.kt │ │ └── res │ │ ├── drawable │ │ ├── qpv_ic_default_add.xml │ │ ├── qpv_ic_default_add_disabled.xml │ │ ├── qpv_ic_default_remove.xml │ │ ├── qpv_ic_default_subtract.xml │ │ ├── qpv_ic_default_subtract_disabled.xml │ │ └── qpv_shape_default_background.xml │ │ ├── layout │ │ ├── view_quantity_picker.xml │ │ └── view_quantity_picker_vertical.xml │ │ └── values │ │ ├── attrs.xml │ │ └── dimens.xml ├── rating-bar-compose │ ├── .gitignore │ ├── README.md │ ├── build.gradle.kts │ ├── consumer-rules.pro │ ├── proguard-rules.pro │ └── src │ │ └── main │ │ ├── AndroidManifest.xml │ │ ├── java │ │ └── com │ │ │ └── trendyol │ │ │ └── uicomponents │ │ │ └── ratingbarcompose │ │ │ └── RatingBar.kt │ │ └── res │ │ └── drawable │ │ └── ic_star.xml ├── rating-bar │ ├── .gitignore │ ├── README.md │ ├── build.gradle.kts │ ├── consumer-rules.pro │ ├── proguard-rules.pro │ └── src │ │ └── main │ │ ├── java │ │ └── com │ │ │ └── trendyol │ │ │ └── uicomponents │ │ │ └── ratingbar │ │ │ ├── Extensions.kt │ │ │ ├── RatingBarView.kt │ │ │ └── RatingBarViewState.kt │ │ └── res │ │ ├── drawable │ │ └── ic_star.xml │ │ ├── layout │ │ └── view_rating_bar.xml │ │ └── values │ │ ├── attrs.xml │ │ ├── colors.xml │ │ └── dimens.xml ├── suggestion-input-view │ ├── .gitignore │ ├── README.md │ ├── build.gradle.kts │ ├── consumer-rules.pro │ ├── proguard-rules.pro │ └── src │ │ └── main │ │ ├── AndroidManifest.xml │ │ ├── java │ │ └── com │ │ │ └── trendyol │ │ │ └── suggestioninputview │ │ │ ├── Extensions.kt │ │ │ ├── Rule.kt │ │ │ ├── RuleValidator.kt │ │ │ ├── SuggestionInputBadge.kt │ │ │ ├── SuggestionInputEditText.kt │ │ │ ├── SuggestionInputItem.kt │ │ │ ├── SuggestionInputItemViewState.kt │ │ │ ├── SuggestionInputView.kt │ │ │ ├── SuggestionInputViewState.kt │ │ │ ├── SuggestionItemAdapter.kt │ │ │ └── SuggestionItemType.kt │ │ └── res │ │ ├── drawable │ │ ├── ic_arrow_back.xml │ │ ├── shape_background_suggestion_item_badge.xml │ │ ├── shape_error_background_suggestion_item.xml │ │ ├── shape_selected_background_suggestion_item.xml │ │ └── shape_unselected_background_suggestion_item.xml │ │ ├── layout │ │ ├── item_suggestion.xml │ │ ├── view_suggestion_input.xml │ │ └── view_suggestion_selectables.xml │ │ └── values │ │ ├── attrs.xml │ │ ├── colors.xml │ │ └── dimens.xml ├── timeline-view-compose │ ├── .gitignore │ ├── README.md │ ├── build.gradle.kts │ ├── consumer-rules.pro │ ├── proguard-rules.pro │ └── src │ │ └── main │ │ └── java │ │ └── com │ │ └── trendyol │ │ └── uicomponents │ │ └── timelineviewcompose │ │ ├── HorizontalTimelineWithIndexTextView.kt │ │ ├── Line.kt │ │ ├── ScaleAnimation.kt │ │ ├── TimelinePoint.kt │ │ ├── TimelineView.kt │ │ ├── item │ │ ├── HorizontalTimelineImageItem.kt │ │ ├── HorizontalTimelineItem.kt │ │ ├── HorizontalTimelineWithIndexTextItem.kt │ │ ├── VerticalTimelineImageItem.kt │ │ └── VerticalTimelineItem.kt │ │ └── model │ │ ├── ConstraintSets.kt │ │ ├── FakeTimelineItemProvider.kt │ │ ├── ImageConfig.kt │ │ ├── LineConfig.kt │ │ ├── PointConfig.kt │ │ ├── PointShadowConfig.kt │ │ ├── TimelineItem.kt │ │ ├── TimelineOrientation.kt │ │ └── TimelineViewDefaults.kt ├── timeline-view │ ├── .gitignore │ ├── README.md │ ├── build.gradle.kts │ ├── consumer-rules.pro │ ├── proguard-rules.pro │ └── src │ │ └── main │ │ ├── java │ │ └── com │ │ │ └── trendyol │ │ │ └── timelineview │ │ │ ├── SmoothScroller.kt │ │ │ ├── TimelineItem.kt │ │ │ ├── TimelineItemAdapter.kt │ │ │ ├── TimelineItemViewState.kt │ │ │ ├── TimelineOrientation.kt │ │ │ ├── TimelineView.kt │ │ │ └── TimelineViewState.kt │ │ └── res │ │ ├── drawable │ │ └── shape_oval.xml │ │ ├── layout │ │ ├── item_timeline.xml │ │ ├── item_timeline_vertical.xml │ │ └── view_timeline.xml │ │ └── values │ │ ├── attrs.xml │ │ ├── dimens.xml │ │ └── strings.xml ├── toolbar │ ├── .gitignore │ ├── README.md │ ├── build.gradle.kts │ ├── consumer-rules.pro │ ├── proguard-rules.pro │ └── src │ │ └── main │ │ ├── java │ │ └── com │ │ │ └── trendyol │ │ │ └── uicomponents │ │ │ └── toolbar │ │ │ ├── Extensions.kt │ │ │ ├── Toolbar.kt │ │ │ └── ToolbarViewState.kt │ │ └── res │ │ ├── drawable │ │ ├── orange_dot.xml │ │ └── trendyol_uicomponents_toolbar_arrow_back.xml │ │ ├── layout │ │ └── view_toolbar.xml │ │ └── values │ │ ├── attrs.xml │ │ ├── dimens.xml │ │ └── styles.xml └── touch-delegator │ ├── .gitignore │ ├── build.gradle.kts │ ├── consumer-rules.pro │ ├── proguard-rules.pro │ └── src │ └── main │ └── java │ └── com │ └── trendyol │ └── uicomponents │ └── touchdelegator │ ├── ActivityTouchDelegator.kt │ ├── WindowTouchDelegator.kt │ └── WindowTouchListener.kt ├── sample-compose ├── .gitignore ├── build.gradle.kts ├── proguard-rules.pro └── src │ └── main │ ├── AndroidManifest.xml │ ├── java │ └── com │ │ └── trendyol │ │ └── uicomponents │ │ └── samplecompose │ │ ├── ComponentsScreen.kt │ │ ├── MainActivity.kt │ │ ├── QuantityPickerScreen.kt │ │ ├── RatingBarScreen.kt │ │ ├── Route.kt │ │ ├── SampleComposeNavGraph.kt │ │ ├── TimelineViewItemProvider.kt │ │ ├── TimelineViewScreen.kt │ │ └── ui │ │ ├── productcard │ │ ├── ProductCard.kt │ │ └── ProductCardData.kt │ │ └── theme │ │ ├── Color.kt │ │ ├── Shape.kt │ │ ├── Theme.kt │ │ └── Type.kt │ └── res │ ├── drawable-v24 │ └── ic_launcher_foreground.xml │ ├── drawable │ └── ic_launcher_background.xml │ ├── mipmap-anydpi-v26 │ ├── ic_launcher.xml │ └── ic_launcher_round.xml │ ├── mipmap-anydpi-v33 │ └── ic_launcher.xml │ ├── mipmap-hdpi │ ├── ic_launcher.webp │ └── ic_launcher_round.webp │ ├── mipmap-mdpi │ ├── ic_launcher.webp │ └── ic_launcher_round.webp │ ├── mipmap-xhdpi │ ├── ic_launcher.webp │ └── ic_launcher_round.webp │ ├── mipmap-xxhdpi │ ├── ic_launcher.webp │ └── ic_launcher_round.webp │ ├── mipmap-xxxhdpi │ ├── ic_launcher.webp │ └── ic_launcher_round.webp │ └── values │ ├── colors.xml │ ├── strings.xml │ └── themes.xml ├── sample ├── .gitignore ├── build.gradle.kts ├── proguard-rules.pro └── src │ └── main │ ├── AndroidManifest.xml │ ├── java │ └── com │ │ └── trendyol │ │ └── uicomponents │ │ ├── CardInputViewActivity.kt │ │ ├── DialogsActivity.kt │ │ ├── Extensions.kt │ │ ├── FitOptionMessageViewActivity.kt │ │ ├── ImageSliderActivity.kt │ │ ├── MainActivity.kt │ │ ├── PhoneNumberActivity.kt │ │ ├── QuantityPickerViewActivity.kt │ │ ├── RatingBarActivity.kt │ │ ├── SuggestionInputViewActivity.kt │ │ ├── TimelineViewActivity.kt │ │ ├── ToolbarActivity.kt │ │ ├── WebViewDomAndJSEnabler.kt │ │ ├── WebViewDownloadListenerConfigurator.kt │ │ └── WebViewJavascriptEnabler.kt │ └── res │ ├── drawable-v24 │ └── ic_launcher_foreground.xml │ ├── drawable │ ├── ic_check.xml │ ├── ic_info.xml │ ├── ic_info_black_24.xml │ ├── ic_launcher_background.xml │ ├── ic_mc_logo.xml │ ├── ic_visa_logo.xml │ ├── rounded_corner.xml │ ├── sample_banana.png │ ├── sample_euro.png │ ├── shape_info_list_dialog_divider.xml │ ├── shape_selected_background_suggestion_item.xml │ └── shape_unselected_background_suggestion_item.xml │ ├── layout │ ├── activity_card_input.xml │ ├── activity_dialogs.xml │ ├── activity_fit_option_message.xml │ ├── activity_image_slider.xml │ ├── activity_main.xml │ ├── activity_phone_number.xml │ ├── activity_quantity_picker_view.xml │ ├── activity_rating_bar.xml │ ├── activity_suggestion_input.xml │ ├── activity_timeline_view.xml │ └── activity_toolbar.xml │ ├── mipmap-anydpi-v26 │ ├── ic_launcher.xml │ └── ic_launcher_round.xml │ ├── mipmap-hdpi │ ├── ic_launcher.png │ └── ic_launcher_round.png │ ├── mipmap-mdpi │ ├── ic_launcher.png │ └── ic_launcher_round.png │ ├── mipmap-xhdpi │ ├── ic_launcher.png │ └── ic_launcher_round.png │ ├── mipmap-xxhdpi │ ├── ic_launcher.png │ └── ic_launcher_round.png │ ├── mipmap-xxxhdpi │ ├── ic_launcher.png │ └── ic_launcher_round.png │ ├── values-ar │ └── strings.xml │ └── values │ ├── colors.xml │ ├── dimens.xml │ ├── strings.xml │ └── styles.xml └── settings.gradle.kts /.gitignore: -------------------------------------------------------------------------------- 1 | # Built application files 2 | *.apk 3 | *.ap_ 4 | 5 | # Files for the ART/Dalvik VM 6 | *.dex 7 | 8 | # Java class files 9 | *.class 10 | 11 | # Generated files 12 | bin/ 13 | gen/ 14 | out/ 15 | 16 | # Gradle files 17 | .gradle/ 18 | build/ 19 | 20 | # Local configuration file (sdk path, etc) 21 | local.properties 22 | 23 | # Proguard folder generated by Eclipse 24 | proguard/ 25 | 26 | # Log Files 27 | *.log 28 | 29 | # Android Studio Navigation editor temp files 30 | .navigation/ 31 | 32 | # Android Studio captures folder 33 | captures/ 34 | 35 | # IntelliJ 36 | *.iml 37 | .idea/workspace.xml 38 | .idea/tasks.xml 39 | .idea/gradle.xml 40 | .idea/assetWizardSettings.xml 41 | .idea/dictionaries 42 | .idea/libraries 43 | # Android Studio 3 in .gitignore file. 44 | .idea/caches 45 | .idea/modules.xml 46 | # Comment next line if keeping position of elements in Navigation Editor is relevant for you 47 | .idea/navEditor.xml 48 | .idea/codeStyles/ 49 | 50 | # Keystore files 51 | # Uncomment the following line if you do not want to check your keystore files in. 52 | #*.jks 53 | 54 | # External native build folder generated in Android Studio 2.2 and later 55 | .externalNativeBuild 56 | 57 | # Google Services (e.g. APIs or Firebase) 58 | google-services.json 59 | 60 | # Freeline 61 | freeline.py 62 | freeline/ 63 | freeline_project_description.json 64 | 65 | # fastlane 66 | fastlane/report.xml 67 | fastlane/Preview.html 68 | fastlane/screenshots 69 | fastlane/test_output 70 | fastlane/readme.md 71 | /.idea/ 72 | -------------------------------------------------------------------------------- /PULL_REQUEST_TEMPLATE: -------------------------------------------------------------------------------- 1 | 2 | 3 | ## Types of changes 4 | 5 | - [ ] Bug fix (non-breaking change which fixes an issue) 6 | - [ ] New feature (non-breaking change which adds functionality) 7 | - [ ] Breaking change (fix or feature that would cause existing functionality to change) 8 | 9 | ## Description 10 | 11 | 12 | ## Motivation and Context 13 | 14 | 15 | 16 | ## How Has This Been Tested? 17 | 18 | 19 | 20 | 21 | ## Screenshots (if appropriate): 22 | 23 | ## Checklist: 24 | 25 | 26 | - [ ] My change requires a change to the documentation. 27 | - [ ] I have updated the documentation accordingly. 28 | -------------------------------------------------------------------------------- /build.gradle.kts: -------------------------------------------------------------------------------- 1 | // Top-level build file where you can add configuration options common to all sub-projects/modules. 2 | 3 | buildscript { 4 | repositories { 5 | google() 6 | mavenCentral() 7 | } 8 | 9 | dependencies { 10 | classpath(Plugins.androidGradlePlugin) 11 | classpath(Plugins.kotlinGradlePlugin) 12 | } 13 | } 14 | 15 | allprojects { 16 | repositories { 17 | google() 18 | mavenCentral() 19 | maven("https://jitpack.io") 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /buildSrc/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | -------------------------------------------------------------------------------- /buildSrc/build.gradle.kts: -------------------------------------------------------------------------------- 1 | repositories { 2 | google() 3 | mavenCentral() 4 | } 5 | plugins { 6 | `kotlin-dsl` 7 | } 8 | -------------------------------------------------------------------------------- /buildSrc/settings.gradle.kts: -------------------------------------------------------------------------------- 1 | rootProject.name = "trendyol-android-ui-components-buildSrc" -------------------------------------------------------------------------------- /buildSrc/src/main/kotlin/Configs.kt: -------------------------------------------------------------------------------- 1 | object Configs { 2 | 3 | const val compileSdkVersion = 34 4 | const val targetSdkVersion = 34 5 | const val minSdkVersion = 21 6 | const val buildToolsVersion = "34.0.0" 7 | 8 | const val applicationId = "com.trendyol.uicomponents" 9 | } 10 | -------------------------------------------------------------------------------- /buildSrc/src/main/kotlin/Dependencies.kt: -------------------------------------------------------------------------------- 1 | object Dependencies { 2 | 3 | const val coreKtx = "androidx.core:core-ktx:1.3.2" 4 | const val appCompat = "androidx.appcompat:appcompat:1.2.0" 5 | const val material = "com.google.android.material:material:1.4.0" 6 | const val constraintLayout = "androidx.constraintlayout:constraintlayout:2.0.4" 7 | const val recyclerView = "androidx.recyclerview:recyclerview:1.2.0" 8 | const val circleIndicator = "com.github.MertNYuksel:CircleIndicator:2a2e973374" 9 | const val glide = "com.github.bumptech.glide:glide:4.13.2" 10 | const val lifecycleExtensions = "androidx.lifecycle:lifecycle-extensions:2.1.0" 11 | const val lifecycleCompiler = "androidx.lifecycle:lifecycle-compiler:2.1.0" 12 | 13 | const val composeBom = "androidx.compose:compose-bom:2023.05.01" 14 | const val composeActivity = "androidx.activity:activity-compose:1.3.0-alpha07" 15 | const val composeMaterial = "androidx.compose.material:material" 16 | const val composeUiTooling = "androidx.compose.ui:ui-tooling" 17 | const val composeRuntime = "androidx.compose.runtime:runtime" 18 | const val composeCoil = "io.coil-kt:coil-compose:2.2.1" 19 | const val composeConstraintLayout = "androidx.constraintlayout:constraintlayout-compose:1.1.0-alpha04" 20 | const val composeNavigation = "androidx.navigation:navigation-compose:2.5.3" 21 | const val kotlinCompilerExtensionVersion = "1.4.4" 22 | } 23 | -------------------------------------------------------------------------------- /buildSrc/src/main/kotlin/Plugins.kt: -------------------------------------------------------------------------------- 1 | object Plugins { 2 | 3 | private const val kotlinVersion = "2.0.0" 4 | const val androidGradlePlugin = "com.android.tools.build:gradle:8.5.0" 5 | const val kotlinGradlePlugin = "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlinVersion" 6 | 7 | const val androidApplication = "com.android.application" 8 | const val androidLibrary = "com.android.library" 9 | const val kotlinAndroid = "kotlin-android" 10 | const val kotlinKapt = "kotlin-kapt" 11 | const val kotlinParcelize = "kotlin-parcelize" 12 | const val mavenPublish = "publish" 13 | const val compose = "org.jetbrains.kotlin.plugin.compose" 14 | 15 | } 16 | -------------------------------------------------------------------------------- /buildSrc/src/main/kotlin/publish.gradle.kts: -------------------------------------------------------------------------------- 1 | plugins { 2 | id("maven-publish") 3 | } 4 | 5 | afterEvaluate { 6 | publishing.publications { 7 | create("release") { 8 | from(components.getByName("release")) 9 | } 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /gradle.properties: -------------------------------------------------------------------------------- 1 | org.gradle.jvmargs=-Dfile.encoding=UTF-8 2 | org.gradle.caching=true 3 | org.gradle.daemon=true 4 | org.gradle.configureondemand=true 5 | 6 | android.useAndroidX=true 7 | android.enableJetifier=true 8 | 9 | kapt.include.compile.classpath=false 10 | kapt.incremental.apt=false 11 | -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Trendyol/android-ui-components/e98a30ce544f7c016f5a991e816736ea8833949b/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionBase=GRADLE_USER_HOME 2 | distributionPath=wrapper/dists 3 | distributionUrl=https\://services.gradle.org/distributions/gradle-8.8-bin.zip 4 | networkTimeout=10000 5 | validateDistributionUrl=true 6 | zipStoreBase=GRADLE_USER_HOME 7 | zipStorePath=wrapper/dists 8 | -------------------------------------------------------------------------------- /images/card-input-view-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Trendyol/android-ui-components/e98a30ce544f7c016f5a991e816736ea8833949b/images/card-input-view-1.png -------------------------------------------------------------------------------- /images/card-input-view-2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Trendyol/android-ui-components/e98a30ce544f7c016f5a991e816736ea8833949b/images/card-input-view-2.png -------------------------------------------------------------------------------- /images/dialogs-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Trendyol/android-ui-components/e98a30ce544f7c016f5a991e816736ea8833949b/images/dialogs-1.png -------------------------------------------------------------------------------- /images/dialogs-2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Trendyol/android-ui-components/e98a30ce544f7c016f5a991e816736ea8833949b/images/dialogs-2.png -------------------------------------------------------------------------------- /images/dialogs-3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Trendyol/android-ui-components/e98a30ce544f7c016f5a991e816736ea8833949b/images/dialogs-3.png -------------------------------------------------------------------------------- /images/dialogs-4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Trendyol/android-ui-components/e98a30ce544f7c016f5a991e816736ea8833949b/images/dialogs-4.png -------------------------------------------------------------------------------- /images/dialogs-5.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Trendyol/android-ui-components/e98a30ce544f7c016f5a991e816736ea8833949b/images/dialogs-5.png -------------------------------------------------------------------------------- /images/fitoptionmessageview.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Trendyol/android-ui-components/e98a30ce544f7c016f5a991e816736ea8833949b/images/fitoptionmessageview.png -------------------------------------------------------------------------------- /images/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Trendyol/android-ui-components/e98a30ce544f7c016f5a991e816736ea8833949b/images/logo.png -------------------------------------------------------------------------------- /images/quantity-picker-compose.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Trendyol/android-ui-components/e98a30ce544f7c016f5a991e816736ea8833949b/images/quantity-picker-compose.gif -------------------------------------------------------------------------------- /images/quantity-picker-view-1.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Trendyol/android-ui-components/e98a30ce544f7c016f5a991e816736ea8833949b/images/quantity-picker-view-1.gif -------------------------------------------------------------------------------- /images/rating-bar-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Trendyol/android-ui-components/e98a30ce544f7c016f5a991e816736ea8833949b/images/rating-bar-1.png -------------------------------------------------------------------------------- /images/suggestion-input-view-1.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Trendyol/android-ui-components/e98a30ce544f7c016f5a991e816736ea8833949b/images/suggestion-input-view-1.gif -------------------------------------------------------------------------------- /images/timeline-view-compose-horizontal-animated.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Trendyol/android-ui-components/e98a30ce544f7c016f5a991e816736ea8833949b/images/timeline-view-compose-horizontal-animated.gif -------------------------------------------------------------------------------- /images/timeline-view-compose-horizontal.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Trendyol/android-ui-components/e98a30ce544f7c016f5a991e816736ea8833949b/images/timeline-view-compose-horizontal.png -------------------------------------------------------------------------------- /images/timeline-view-compose-vertical-animated.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Trendyol/android-ui-components/e98a30ce544f7c016f5a991e816736ea8833949b/images/timeline-view-compose-vertical-animated.gif -------------------------------------------------------------------------------- /images/timeline-view-compose-vertical.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Trendyol/android-ui-components/e98a30ce544f7c016f5a991e816736ea8833949b/images/timeline-view-compose-vertical.gif -------------------------------------------------------------------------------- /images/timeline-view.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Trendyol/android-ui-components/e98a30ce544f7c016f5a991e816736ea8833949b/images/timeline-view.png -------------------------------------------------------------------------------- /images/toolbar-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Trendyol/android-ui-components/e98a30ce544f7c016f5a991e816736ea8833949b/images/toolbar-1.png -------------------------------------------------------------------------------- /images/uic1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Trendyol/android-ui-components/e98a30ce544f7c016f5a991e816736ea8833949b/images/uic1.png -------------------------------------------------------------------------------- /images/uic2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Trendyol/android-ui-components/e98a30ce544f7c016f5a991e816736ea8833949b/images/uic2.png -------------------------------------------------------------------------------- /images/uic3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Trendyol/android-ui-components/e98a30ce544f7c016f5a991e816736ea8833949b/images/uic3.png -------------------------------------------------------------------------------- /images/uic4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Trendyol/android-ui-components/e98a30ce544f7c016f5a991e816736ea8833949b/images/uic4.png -------------------------------------------------------------------------------- /images/uic5.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Trendyol/android-ui-components/e98a30ce544f7c016f5a991e816736ea8833949b/images/uic5.png -------------------------------------------------------------------------------- /libraries/card-input-view/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | -------------------------------------------------------------------------------- /libraries/card-input-view/build.gradle.kts: -------------------------------------------------------------------------------- 1 | plugins { 2 | id(Plugins.androidLibrary) 3 | id(Plugins.kotlinAndroid) 4 | id(Plugins.mavenPublish) 5 | } 6 | 7 | kotlin.jvmToolchain(17) 8 | 9 | android { 10 | compileSdk = Configs.compileSdkVersion 11 | buildToolsVersion = Configs.buildToolsVersion 12 | 13 | defaultConfig { 14 | minSdk = Configs.minSdkVersion 15 | 16 | vectorDrawables.useSupportLibrary = true 17 | } 18 | 19 | buildTypes { 20 | getByName("release") { 21 | isMinifyEnabled = false 22 | setProguardFiles( 23 | mutableListOf( 24 | getDefaultProguardFile("proguard-android.txt"), 25 | "proguard-rules.pro" 26 | ) 27 | ) 28 | } 29 | } 30 | 31 | namespace = "com.trendyol.cardinputview" 32 | 33 | buildFeatures.viewBinding = true 34 | 35 | compileOptions { 36 | sourceCompatibility = JavaVersion.VERSION_17 37 | targetCompatibility = JavaVersion.VERSION_17 38 | } 39 | } 40 | 41 | dependencies { 42 | implementation(Dependencies.coreKtx) 43 | implementation(Dependencies.constraintLayout) 44 | implementation(Dependencies.material) 45 | } 46 | -------------------------------------------------------------------------------- /libraries/card-input-view/consumer-rules.pro: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Trendyol/android-ui-components/e98a30ce544f7c016f5a991e816736ea8833949b/libraries/card-input-view/consumer-rules.pro -------------------------------------------------------------------------------- /libraries/card-input-view/proguard-rules.pro: -------------------------------------------------------------------------------- 1 | # Add project specific ProGuard rules here. 2 | # You can control the set of applied configuration files using the 3 | # proguardFiles setting in build.gradle. 4 | # 5 | # For more details, see 6 | # http://developer.android.com/guide/developing/tools/proguard.html 7 | 8 | # If your project uses WebView with JS, uncomment the following 9 | # and specify the fully qualified class name to the JavaScript interface 10 | # class: 11 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview { 12 | # public *; 13 | #} 14 | 15 | # Uncomment this to preserve the line number information for 16 | # debugging stack traces. 17 | #-keepattributes SourceFile,LineNumberTable 18 | 19 | # If you keep the line number information, uncomment this to 20 | # hide the original source file name. 21 | #-renamesourcefileattribute SourceFile 22 | -------------------------------------------------------------------------------- /libraries/card-input-view/src/main/java/com/trendyol/cardinputview/CardInformation.kt: -------------------------------------------------------------------------------- 1 | package com.trendyol.cardinputview 2 | 3 | data class CardInformation( 4 | val cardNumber: String = "", 5 | val cvv: String = "", 6 | val expiryMonth: String = "", 7 | val expiryYear: String = "" 8 | ) 9 | -------------------------------------------------------------------------------- /libraries/card-input-view/src/main/java/com/trendyol/cardinputview/CreditCardType.kt: -------------------------------------------------------------------------------- 1 | package com.trendyol.cardinputview 2 | 3 | enum class CreditCardType( 4 | val prefixLength: Int, 5 | val prefixes: List, 6 | val cvvLength: Int, 7 | val digitPattern: String, 8 | ) { 9 | MASTER_CARD(2, (51..55).toList(), 3, "xxxx xxxx xxxx xxxx"), 10 | VISA(1, listOf(4), 3, "xxxx xxxx xxxx xxxx"), 11 | AMERICAN_EXPRESS(2, listOf(34, 37), 4, "xxxx xxxxxx xxxxx"), 12 | DEFAULT(1, (0..9).toList(), 3, "xxxx xxxx xxxx xxxx"); 13 | 14 | companion object { 15 | 16 | fun getCreditCardType(creditCardTypes: List, creditCardNumber: String?): CreditCardType { 17 | if (creditCardNumber.isNullOrBlank() || creditCardTypes.isEmpty()) return DEFAULT 18 | 19 | run loop@{ 20 | creditCardTypes.forEach { type -> 21 | if (creditCardNumber.length < type.prefixLength) return@loop 22 | 23 | val uniquePrefix = creditCardNumber.substring(0 until type.prefixLength).toInt() 24 | val matches = type.prefixes.contains(uniquePrefix) 25 | if (matches) return type 26 | } 27 | } 28 | return DEFAULT 29 | } 30 | 31 | const val DIGIT_PATTERN_MARK = 'x' 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /libraries/card-input-view/src/main/java/com/trendyol/cardinputview/Extensions.kt: -------------------------------------------------------------------------------- 1 | package com.trendyol.cardinputview 2 | 3 | import android.content.Context 4 | import android.graphics.drawable.Drawable 5 | import android.text.Editable 6 | import android.text.InputFilter 7 | import android.view.View 8 | import android.view.inputmethod.InputMethodManager 9 | import androidx.annotation.ColorInt 10 | import androidx.annotation.ColorRes 11 | import androidx.annotation.DrawableRes 12 | import androidx.core.content.ContextCompat 13 | 14 | @ColorInt 15 | internal fun Context.color(@ColorRes colorResId: Int): Int = 16 | ContextCompat.getColor(this, colorResId) 17 | 18 | internal fun Context.drawable(@DrawableRes drawableResId: Int): Drawable? = 19 | ContextCompat.getDrawable(this, drawableResId) 20 | 21 | internal fun View.showKeyboard() { 22 | val imm = context.getSystemService(Context.INPUT_METHOD_SERVICE) as InputMethodManager 23 | postDelayed({ 24 | requestFocus() 25 | imm.showSoftInput(this, InputMethodManager.SHOW_IMPLICIT) 26 | }, 100L) 27 | } 28 | 29 | internal fun View.hideKeyboard() { 30 | val imm = context.getSystemService(Context.INPUT_METHOD_SERVICE) as InputMethodManager 31 | imm.hideSoftInputFromWindow(windowToken, 0) 32 | } 33 | 34 | internal fun String.removeNonDigitCharacters() = replace("[^\\d]".toRegex(), "") 35 | 36 | internal fun Editable.updateText(currentText: String) { 37 | val currentFilters = filters 38 | filters = arrayOf() 39 | replace(0, length, currentText, 0, currentText.length) 40 | filters = currentFilters 41 | } 42 | 43 | /** 44 | * Set debounce time(millis) to onClickListener for prevent multiple clicks. 45 | * @param debounceMillis: Millis time that gives delay between clicks. 46 | * @param onClickListener: Lambda function that invokes click listener. 47 | */ 48 | fun View.setDebouncedOnClickListener(debounceMillis: Long = 500L, onClickListener: View.OnClickListener) { 49 | var lastClickTime: Long = 0 50 | setOnClickListener { view -> 51 | val shouldAcceptClick = (System.currentTimeMillis() - lastClickTime) > debounceMillis 52 | if (shouldAcceptClick) { 53 | lastClickTime = System.currentTimeMillis() 54 | onClickListener.onClick(view) 55 | } 56 | } 57 | } -------------------------------------------------------------------------------- /libraries/card-input-view/src/main/java/com/trendyol/cardinputview/formatter/CardNumberFormatterTextWatcher.kt: -------------------------------------------------------------------------------- 1 | package com.trendyol.cardinputview.formatter 2 | 3 | import android.text.Editable 4 | import android.text.TextWatcher 5 | import com.trendyol.cardinputview.CreditCardType 6 | import com.trendyol.cardinputview.updateText 7 | import java.util.concurrent.atomic.AtomicBoolean 8 | 9 | internal class CardNumberFormatterTextWatcher( 10 | private val supportedCardTypes: List, 11 | ) : TextWatcher { 12 | 13 | private var editing: AtomicBoolean = AtomicBoolean(false) 14 | private val creditCardMasker = CreditCardMasker() 15 | 16 | override fun onTextChanged(s: CharSequence, start: Int, before: Int, count: Int) { 17 | } 18 | 19 | override fun beforeTextChanged(s: CharSequence, start: Int, count: Int, after: Int) { 20 | } 21 | 22 | override fun afterTextChanged(s: Editable) { 23 | if (editing.get()) return 24 | editing.set(true) 25 | 26 | val maskedCardNumber = creditCardMasker.mask(s.toString(), supportedCardTypes) 27 | s.updateText(maskedCardNumber) 28 | 29 | editing.set(false) 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /libraries/card-input-view/src/main/java/com/trendyol/cardinputview/formatter/CreditCardMasker.kt: -------------------------------------------------------------------------------- 1 | package com.trendyol.cardinputview.formatter 2 | 3 | import com.trendyol.cardinputview.CreditCardType 4 | import com.trendyol.cardinputview.CreditCardType.Companion.DIGIT_PATTERN_MARK 5 | import com.trendyol.cardinputview.removeNonDigitCharacters 6 | 7 | internal class CreditCardMasker { 8 | 9 | fun mask(creditCardNumber: String, supportedCardTypes: List): String { 10 | val clearedCreditCardNumber = creditCardNumber.removeNonDigitCharacters() 11 | val creditCardType = CreditCardType.getCreditCardType(supportedCardTypes, clearedCreditCardNumber) 12 | return format(clearedCreditCardNumber, creditCardType.digitPattern) 13 | } 14 | 15 | private fun format(cardNumber: String, pattern: String): String { 16 | var formattedCardNumber = "" 17 | var cardNumberIteratorIndex = 0 18 | run loop@{ 19 | pattern.forEach { character -> 20 | if (character == DIGIT_PATTERN_MARK) { 21 | val digit = cardNumber.getOrNull(cardNumberIteratorIndex) ?: return@loop 22 | formattedCardNumber += digit 23 | cardNumberIteratorIndex++ 24 | } else { 25 | formattedCardNumber += character 26 | } 27 | } 28 | } 29 | return formattedCardNumber.trim() 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /libraries/card-input-view/src/main/java/com/trendyol/cardinputview/validator/CreditCardValidator.kt: -------------------------------------------------------------------------------- 1 | package com.trendyol.cardinputview.validator 2 | 3 | import com.trendyol.cardinputview.CreditCardType 4 | 5 | internal class CreditCardValidator { 6 | 7 | fun isCardNumberValid(cardNumber: String?, supportedCardTypes: List): Boolean { 8 | return LuhnValidator().isValid(cardNumber, supportedCardTypes) 9 | } 10 | 11 | fun isCvvValid(cvv: String?, creditCardNumber: String?, supportedCardTypes: List): Boolean { 12 | val cvvLength = CreditCardType.getCreditCardType(supportedCardTypes, creditCardNumber).cvvLength 13 | var cvvRegex = "" 14 | repeat(cvvLength) { cvvRegex += NUMBER_REGEX_PATTERN } 15 | 16 | return cvv?.matches(cvvRegex.toRegex()) == true 17 | } 18 | 19 | fun isExpiryMonthValid(month: String?) = month?.matches("\\d\\d".toRegex()) == true 20 | 21 | fun isExpiryYearValid(year: String?) = year?.matches("\\d\\d".toRegex()) == true 22 | 23 | companion object { 24 | private const val NUMBER_REGEX_PATTERN = "\\d" 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /libraries/card-input-view/src/main/java/com/trendyol/cardinputview/validator/LuhnValidator.kt: -------------------------------------------------------------------------------- 1 | package com.trendyol.cardinputview.validator 2 | 3 | import com.trendyol.cardinputview.CreditCardType 4 | 5 | internal class LuhnValidator { 6 | 7 | fun isValid(input: String?, supportedCardTypes: List): Boolean { 8 | val creditCardNumber = input ?: return false 9 | val creditCardType = CreditCardType.getCreditCardType(supportedCardTypes, creditCardNumber) 10 | val sanitizedInput = creditCardNumber.replace(" ", "") 11 | val sanitizedCardTypePattern = creditCardType.digitPattern.replace(" ", "") 12 | 13 | if (sanitizedInput.length < sanitizedCardTypePattern.length) return false 14 | 15 | return when { 16 | valid(sanitizedInput) -> checksum(sanitizedInput) % 10 == 0 17 | else -> false 18 | } 19 | } 20 | 21 | private fun valid(input: String) = input.all(Char::isDigit) && input.length > 1 22 | 23 | private fun checksum(input: String) = addends(input).sum() 24 | 25 | private fun addends(input: String) = input.digits().mapIndexed { i, j -> 26 | when { 27 | (input.length - i + 1) % 2 == 0 -> j 28 | j >= 5 -> j * 2 - 9 29 | else -> j * 2 30 | } 31 | } 32 | 33 | private fun String.digits() = this.map(Character::getNumericValue) 34 | } 35 | -------------------------------------------------------------------------------- /libraries/card-input-view/src/main/res/drawable/ic_card_input_down_arrow.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /libraries/card-input-view/src/main/res/drawable/shape_card_input_cvv_info_background.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | 7 | 10 | 11 | -------------------------------------------------------------------------------- /libraries/card-input-view/src/main/res/drawable/shape_card_input_field_background.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | 7 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /libraries/card-input-view/src/main/res/drawable/shape_card_input_field_error_background.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | 7 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /libraries/card-input-view/src/main/res/values/attrs.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /libraries/card-input-view/src/main/res/values/colors.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | #dddddd 4 | #e6e6e6 5 | #f5f5f5 6 | #f6dde1 7 | #d0021b 8 | #ffffff 9 | #e5e5e5 10 | -------------------------------------------------------------------------------- /libraries/card-input-view/src/main/res/values/dimens.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 4dp 5 | 8dp 6 | 16dp 7 | 8 | 40dp 9 | 80dp 10 | 28dp 11 | 0.5dp 12 | 0.5dp 13 | 1.5dp 14 | 15 | -------------------------------------------------------------------------------- /libraries/card-input-view/src/main/res/values/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | \? 4 | -------------------------------------------------------------------------------- /libraries/dialogs/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | -------------------------------------------------------------------------------- /libraries/dialogs/build.gradle.kts: -------------------------------------------------------------------------------- 1 | import com.android.build.gradle.internal.dsl.BuildType 2 | 3 | plugins { 4 | id(Plugins.androidLibrary) 5 | id(Plugins.kotlinAndroid) 6 | id(Plugins.kotlinParcelize) 7 | id(Plugins.mavenPublish) 8 | } 9 | 10 | android { 11 | compileSdk = Configs.compileSdkVersion 12 | buildToolsVersion = Configs.buildToolsVersion 13 | 14 | defaultConfig { 15 | minSdk = Configs.minSdkVersion 16 | vectorDrawables.useSupportLibrary = true 17 | 18 | consumerProguardFiles("consumer-rules.pro") 19 | } 20 | buildTypes { 21 | getByName("release") { 22 | isMinifyEnabled = false 23 | setProguardFiles( 24 | mutableListOf( 25 | getDefaultProguardFile("proguard-android.txt"), 26 | "proguard-rules.pro" 27 | ) 28 | ) 29 | } 30 | } 31 | 32 | buildFeatures { 33 | viewBinding = true 34 | buildConfig = false 35 | } 36 | 37 | namespace = "com.trendyol.dialog" 38 | 39 | compileOptions { 40 | sourceCompatibility = JavaVersion.VERSION_17 41 | targetCompatibility = JavaVersion.VERSION_17 42 | } 43 | } 44 | 45 | dependencies { 46 | implementation(Dependencies.appCompat) 47 | implementation(Dependencies.coreKtx) 48 | implementation(Dependencies.material) 49 | implementation(Dependencies.constraintLayout) 50 | implementation(Dependencies.lifecycleExtensions) 51 | } 52 | -------------------------------------------------------------------------------- /libraries/dialogs/consumer-rules.pro: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Trendyol/android-ui-components/e98a30ce544f7c016f5a991e816736ea8833949b/libraries/dialogs/consumer-rules.pro -------------------------------------------------------------------------------- /libraries/dialogs/proguard-rules.pro: -------------------------------------------------------------------------------- 1 | # Add project specific ProGuard rules here. 2 | # You can control the set of applied configuration files using the 3 | # proguardFiles setting in build.gradle. 4 | # 5 | # For more details, see 6 | # http://developer.android.com/guide/developing/tools/proguard.html 7 | 8 | # If your project uses WebView with JS, uncomment the following 9 | # and specify the fully qualified class name to the JavaScript interface 10 | # class: 11 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview { 12 | # public *; 13 | #} 14 | 15 | # Uncomment this to preserve the line number information for 16 | # debugging stack traces. 17 | #-keepattributes SourceFile,LineNumberTable 18 | 19 | # If you keep the line number information, uncomment this to 20 | # hide the original source file name. 21 | #-renamesourcefileattribute SourceFile 22 | -------------------------------------------------------------------------------- /libraries/dialogs/src/main/java/com/trendyol/uicomponents/dialogs/BaseBottomSheetDialog.kt: -------------------------------------------------------------------------------- 1 | package com.trendyol.uicomponents.dialogs 2 | 3 | import android.os.Bundle 4 | import com.google.android.material.bottomsheet.BottomSheetDialogFragment 5 | import com.trendyol.dialog.R 6 | 7 | abstract class BaseBottomSheetDialog : BottomSheetDialogFragment() { 8 | 9 | abstract fun setUpView() 10 | 11 | abstract fun setViewState() 12 | 13 | override fun onCreate(savedInstanceState: Bundle?) { 14 | super.onCreate(savedInstanceState) 15 | setStyle(STYLE_NO_FRAME, R.style.Trendyol_UIComponents_Dialogs_BottomSheetDialogStyle) 16 | } 17 | 18 | override fun onActivityCreated(savedInstanceState: Bundle?) { 19 | super.onActivityCreated(savedInstanceState) 20 | setUpView().also { setViewState() } 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /libraries/dialogs/src/main/java/com/trendyol/uicomponents/dialogs/BuilderExtensions.kt: -------------------------------------------------------------------------------- 1 | package com.trendyol.uicomponents.dialogs 2 | 3 | fun infoDialog(block: InfoDialogBuilder.() -> Unit): DialogFragment = 4 | InfoDialogBuilder().buildInfoDialog(block) 5 | 6 | fun infoListDialog(block: InfoListDialogBuilder.() -> Unit): DialogFragment = 7 | InfoListDialogBuilder().buildInfoListDialog(block) 8 | 9 | fun agreementDialog(block: AgreementDialogBuilder.() -> Unit): DialogFragment = 10 | AgreementDialogBuilder().buildAgreementDialog(block) 11 | 12 | fun selectionDialog(block: SelectionDialogBuilder.() -> Unit): DialogFragment = 13 | SelectionDialogBuilder().buildSelectionDialog(block) 14 | -------------------------------------------------------------------------------- /libraries/dialogs/src/main/java/com/trendyol/uicomponents/dialogs/DialogFragmentArguments.kt: -------------------------------------------------------------------------------- 1 | package com.trendyol.uicomponents.dialogs 2 | 3 | import android.os.Bundle 4 | import android.os.Parcelable 5 | import androidx.annotation.ColorInt 6 | import androidx.annotation.ColorRes 7 | import androidx.annotation.DrawableRes 8 | import androidx.annotation.FontRes 9 | import androidx.core.os.bundleOf 10 | import kotlinx.parcelize.Parcelize 11 | 12 | @Parcelize 13 | class DialogFragmentArguments( 14 | val title: CharSequence? = null, 15 | val showCloseButton: Boolean? = null, 16 | @ColorInt val closeButtonColor: Int? = null, 17 | @DrawableRes val closeButtonDrawable: Int? = null, 18 | val animateCornerRadiusWhenExpand: Boolean = true, 19 | val cornerRadius: Float? = null, 20 | val horizontalPadding: Float? = null, 21 | val verticalPadding: Float? = null, 22 | val content: CharSequence? = null, 23 | val showContentAsHtml: Boolean = false, 24 | @DrawableRes val contentImage: Int? = null, 25 | val leftButtonText: String? = null, 26 | val rightButtonText: String? = null, 27 | val items: List>? = null, 28 | val showItemsAsHtml: Boolean = false, 29 | val enableSearch: Boolean = false, 30 | val showClearSearchButton: Boolean = false, 31 | val searchHint: String = "", 32 | @DrawableRes val selectedItemDrawable: Int? = null, 33 | @ColorRes val selectedTextColor: Int? = null, 34 | val showRadioButton: Boolean = false, 35 | @ColorRes val titleBackgroundColor: Int? = null, 36 | @ColorRes val titleTextColor: Int? = null, 37 | val titleTextPosition: TextPosition? = null, 38 | val contentTextPosition: TextPosition? = null, 39 | val webViewContent: WebViewContent? = null, 40 | val infoListItems: List>? = null, 41 | val itemDividers: List = emptyList(), 42 | val isFullHeightWebView: Boolean = false, 43 | @FontRes val titleFontFamily: Int? = null, 44 | @FontRes val contentFontFamily: Int? = null 45 | ) : Parcelable { 46 | 47 | fun toBundle() = bundleOf("ARGUMENTS" to this) 48 | 49 | companion object { 50 | fun fromBundle(bundle: Bundle) = bundle 51 | .getParcelable("ARGUMENTS") 52 | } 53 | } -------------------------------------------------------------------------------- /libraries/dialogs/src/main/java/com/trendyol/uicomponents/dialogs/SingleLiveEvent.kt: -------------------------------------------------------------------------------- 1 | package com.trendyol.uicomponents.dialogs 2 | 3 | import androidx.annotation.MainThread 4 | import androidx.lifecycle.LifecycleOwner 5 | import androidx.lifecycle.MutableLiveData 6 | import androidx.lifecycle.Observer 7 | import java.util.concurrent.atomic.AtomicBoolean 8 | 9 | /** 10 | * A lifecycle-aware observable that sends only new updates after subscription, used for events like 11 | * navigation and Snackbar messages. 12 | * 13 | * 14 | * This avoids a common problem with events: on configuration change (like rotation) an update 15 | * can be emitted if the observer is active. This LiveData only calls the observable if there's an 16 | * explicit call to setValue() or call(). 17 | * 18 | * 19 | * Note that only one observer is going to be notified of changes. 20 | * 21 | * Source: https://github.com/android/play-billing-samples/blob/master/ClassyTaxi/android/ClassyTaxi/app/src/main/java/com/example/subscriptions/ui/SingleLiveEvent.kt 22 | */ 23 | internal class SingleLiveEvent : MutableLiveData() { 24 | 25 | private val pending = AtomicBoolean(false) 26 | 27 | @MainThread 28 | override fun observe(owner: LifecycleOwner, observer: Observer) { 29 | // Observe the internal MutableLiveData 30 | super.observe(owner, Observer { t -> 31 | if (pending.compareAndSet(true, false)) { 32 | observer.onChanged(t) 33 | } 34 | }) 35 | } 36 | 37 | @MainThread 38 | override fun setValue(t: T?) { 39 | pending.set(true) 40 | super.setValue(t) 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /libraries/dialogs/src/main/java/com/trendyol/uicomponents/dialogs/TextPosition.kt: -------------------------------------------------------------------------------- 1 | package com.trendyol.uicomponents.dialogs 2 | 3 | enum class TextPosition { 4 | END, START, CENTER 5 | } -------------------------------------------------------------------------------- /libraries/dialogs/src/main/java/com/trendyol/uicomponents/dialogs/WebViewContent.kt: -------------------------------------------------------------------------------- 1 | package com.trendyol.uicomponents.dialogs 2 | 3 | import android.os.Parcelable 4 | import kotlinx.parcelize.Parcelize 5 | 6 | sealed class WebViewContent : Parcelable { 7 | 8 | @Parcelize 9 | data class UrlContent(val url: String) : WebViewContent() 10 | 11 | @Parcelize 12 | data class DataContent(val data: String) : WebViewContent() 13 | } -------------------------------------------------------------------------------- /libraries/dialogs/src/main/java/com/trendyol/uicomponents/dialogs/configurator/WebViewConfigurator.kt: -------------------------------------------------------------------------------- 1 | package com.trendyol.uicomponents.dialogs.configurator 2 | 3 | import android.webkit.WebView 4 | import com.trendyol.uicomponents.dialogs.DialogFragment 5 | 6 | interface WebViewConfigurator { 7 | 8 | fun configureWebView( 9 | dialogFragment: DialogFragment, 10 | webView: WebView 11 | ) 12 | 13 | companion object { 14 | const val TAG: String = "WebViewConfigurator" 15 | } 16 | } -------------------------------------------------------------------------------- /libraries/dialogs/src/main/java/com/trendyol/uicomponents/dialogs/configurator/WebViewDownloadConfigurator.kt: -------------------------------------------------------------------------------- 1 | package com.trendyol.uicomponents.dialogs.configurator 2 | 3 | import android.webkit.WebView 4 | import com.trendyol.uicomponents.dialogs.DialogFragment 5 | 6 | interface WebViewDownloadConfigurator { 7 | 8 | fun configureDownloadListener( 9 | fragment: DialogFragment, 10 | webView: WebView 11 | ) 12 | 13 | companion object { 14 | const val TAG: String = "WebViewDownloadConfigurator" 15 | } 16 | } -------------------------------------------------------------------------------- /libraries/dialogs/src/main/java/com/trendyol/uicomponents/dialogs/list/DialogListItemViewState.kt: -------------------------------------------------------------------------------- 1 | package com.trendyol.uicomponents.dialogs.list 2 | 3 | import android.content.Context 4 | import android.graphics.drawable.Drawable 5 | import android.view.View 6 | import androidx.annotation.FontRes 7 | import androidx.core.content.ContextCompat 8 | import androidx.core.content.res.ResourcesCompat 9 | import androidx.core.text.HtmlCompat 10 | import com.trendyol.dialog.R 11 | 12 | data class DialogListItemViewState( 13 | val name: CharSequence, 14 | val showAsHtml: Boolean, 15 | val selectedItemDrawable: Int?, 16 | val selectedTextColor: Int?, 17 | val isChecked: Boolean, 18 | val showRadioButton: Boolean, 19 | @FontRes val contentFontFamily: Int?, 20 | ) { 21 | 22 | fun getText(): CharSequence = 23 | if (showAsHtml) { 24 | HtmlCompat.fromHtml(name.toString(), HtmlCompat.FROM_HTML_MODE_COMPACT) 25 | } else { 26 | name 27 | } 28 | 29 | fun getSelectedItemDrawable(context: Context): Drawable? = 30 | selectedItemDrawable?.let { ContextCompat.getDrawable(context, it) } 31 | 32 | fun getSelectedItemDrawableVisibility(): Int = 33 | if (selectedItemDrawable != null && isChecked) View.VISIBLE else View.INVISIBLE 34 | 35 | fun getSelectedTextColor(context: Context) = 36 | if (selectedTextColor == null || isChecked.not()) { 37 | ContextCompat.getColor(context, R.color.ui_components_dialogs_primary_text_color) 38 | } else { 39 | ContextCompat.getColor(context, selectedTextColor) 40 | } 41 | 42 | fun getRadioButtonVisibility(): Int = if (showRadioButton) View.VISIBLE else View.GONE 43 | 44 | fun getRadioButtonChecked(): Boolean = isChecked 45 | 46 | fun getFontFamily(context: Context) = contentFontFamily?.let { ResourcesCompat.getFont(context, it) } 47 | } 48 | 49 | -------------------------------------------------------------------------------- /libraries/dialogs/src/main/java/com/trendyol/uicomponents/dialogs/list/ItemDecorator.kt: -------------------------------------------------------------------------------- 1 | package com.trendyol.uicomponents.dialogs.list 2 | 3 | import android.graphics.Canvas 4 | import android.graphics.Rect 5 | import android.view.View 6 | import androidx.recyclerview.widget.RecyclerView 7 | import com.trendyol.uicomponents.dialogs.ItemDivider 8 | 9 | class ItemDecorator( 10 | private val itemDivider: ItemDivider 11 | ) : RecyclerView.ItemDecoration() { 12 | 13 | override fun getItemOffsets(outRect: Rect, view: View, parent: RecyclerView, state: RecyclerView.State) { 14 | super.getItemOffsets(outRect, view, parent, state) 15 | itemDivider.decorate(outRect = outRect, view = view, recyclerView = parent, state = state) 16 | } 17 | 18 | override fun onDraw(c: Canvas, parent: RecyclerView, state: RecyclerView.State) { 19 | super.onDraw(c, parent, state) 20 | itemDivider.onDraw(canvas = c, recyclerView = parent, state = state) 21 | } 22 | } -------------------------------------------------------------------------------- /libraries/dialogs/src/main/java/com/trendyol/uicomponents/dialogs/list/ListItemDiffCallback.kt: -------------------------------------------------------------------------------- 1 | package com.trendyol.uicomponents.dialogs.list 2 | 3 | import androidx.recyclerview.widget.DiffUtil 4 | 5 | class ListItemDiffCallback: DiffUtil.ItemCallback>() { 6 | override fun areContentsTheSame( 7 | oldItem: Pair, 8 | newItem: Pair 9 | ): Boolean { 10 | return oldItem.first == newItem.first && oldItem.second.toString() == newItem.second.toString() 11 | } 12 | 13 | override fun areItemsTheSame( 14 | oldItem: Pair, 15 | newItem: Pair 16 | ): Boolean { 17 | return oldItem.second == newItem.second 18 | } 19 | } -------------------------------------------------------------------------------- /libraries/dialogs/src/main/java/com/trendyol/uicomponents/dialogs/list/info/DialogInfoListAdapter.kt: -------------------------------------------------------------------------------- 1 | package com.trendyol.uicomponents.dialogs.list.info 2 | 3 | import android.view.LayoutInflater 4 | import android.view.ViewGroup 5 | import androidx.annotation.FontRes 6 | import androidx.recyclerview.widget.ListAdapter 7 | import androidx.recyclerview.widget.RecyclerView 8 | import com.trendyol.dialog.databinding.ItemUiComponentsInfoListDialogBinding 9 | 10 | internal class DialogInfoListAdapter( 11 | ) : ListAdapter, DialogInfoListAdapter.ItemViewHolder>( 12 | InfoListItemDiffCallback() 13 | ) { 14 | 15 | @FontRes 16 | var contentFontFamily: Int? = null 17 | 18 | fun setItems(list: List>) { 19 | submitList(list.toMutableList()) 20 | } 21 | 22 | override fun onBindViewHolder(holder: ItemViewHolder, position: Int) { 23 | holder.bind(getItem(position)) 24 | } 25 | 26 | override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): ItemViewHolder { 27 | return ItemViewHolder(ItemUiComponentsInfoListDialogBinding.inflate(LayoutInflater.from(parent.context), parent, false)) 28 | } 29 | 30 | inner class ItemViewHolder( 31 | private val binding: ItemUiComponentsInfoListDialogBinding 32 | ) : RecyclerView.ViewHolder(binding.root) { 33 | 34 | fun bind(item: Pair) { 35 | val viewState = DialogInfoListItemViewState( 36 | key = item.first, 37 | value = item.second 38 | ) 39 | 40 | with(binding) { 41 | textKey.text = viewState.key 42 | textValue.text = viewState.value 43 | textKey.typeface = viewState.getFontFamily(textKey.context, contentFontFamily) 44 | textValue.typeface = viewState.getFontFamily(textValue.context, contentFontFamily) 45 | } 46 | } 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /libraries/dialogs/src/main/java/com/trendyol/uicomponents/dialogs/list/info/DialogInfoListItemViewState.kt: -------------------------------------------------------------------------------- 1 | package com.trendyol.uicomponents.dialogs.list.info 2 | 3 | import android.content.Context 4 | import androidx.core.content.res.ResourcesCompat 5 | 6 | data class DialogInfoListItemViewState( 7 | val key: CharSequence, 8 | val value: CharSequence, 9 | ){ 10 | 11 | fun getFontFamily(context: Context, fontFamily:Int?) = fontFamily?.let { ResourcesCompat.getFont(context, it) } 12 | } 13 | 14 | -------------------------------------------------------------------------------- /libraries/dialogs/src/main/java/com/trendyol/uicomponents/dialogs/list/info/InfoListItemDiffCallback.kt: -------------------------------------------------------------------------------- 1 | package com.trendyol.uicomponents.dialogs.list.info 2 | 3 | import androidx.recyclerview.widget.DiffUtil 4 | 5 | class InfoListItemDiffCallback : DiffUtil.ItemCallback>() { 6 | override fun areContentsTheSame( 7 | oldItem: Pair, 8 | newItem: Pair 9 | ): Boolean { 10 | return oldItem == newItem 11 | } 12 | 13 | override fun areItemsTheSame( 14 | oldItem: Pair, 15 | newItem: Pair 16 | ): Boolean { 17 | return oldItem == newItem 18 | } 19 | } -------------------------------------------------------------------------------- /libraries/dialogs/src/main/res/drawable/ic_ui_components_dialogs_close.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /libraries/dialogs/src/main/res/drawable/ic_ui_components_dialogs_radio_button_checked.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /libraries/dialogs/src/main/res/drawable/ic_ui_components_dialogs_radio_button_unchecked.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /libraries/dialogs/src/main/res/drawable/selector_ui_components_dialogs_radio_button.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /libraries/dialogs/src/main/res/layout/item_ui_components_info_list_dialog.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 17 | 18 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /libraries/dialogs/src/main/res/layout/layout_dialog_header.xml: -------------------------------------------------------------------------------- 1 | 2 | 9 | 10 | 18 | 19 | 27 | 28 | -------------------------------------------------------------------------------- /libraries/dialogs/src/main/res/values/colors.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | #666666 5 | #f5f5f5 6 | 7 | -------------------------------------------------------------------------------- /libraries/dialogs/src/main/res/values/dimens.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 16dp 5 | 12dp 6 | 8dp 7 | 8 | 16dp 9 | 10 | 250 11 | 12 | -------------------------------------------------------------------------------- /libraries/dialogs/src/main/res/values/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | Dialog 3 | 4 | -------------------------------------------------------------------------------- /libraries/fit-option-message-view/.gitignore: -------------------------------------------------------------------------------- 1 | /build -------------------------------------------------------------------------------- /libraries/fit-option-message-view/build.gradle.kts: -------------------------------------------------------------------------------- 1 | plugins { 2 | id(Plugins.androidLibrary) 3 | id(Plugins.kotlinAndroid) 4 | id(Plugins.mavenPublish) 5 | } 6 | 7 | kotlin.jvmToolchain(17) 8 | 9 | android { 10 | compileSdk = Configs.compileSdkVersion 11 | buildToolsVersion = Configs.buildToolsVersion 12 | 13 | defaultConfig { 14 | minSdk = Configs.minSdkVersion 15 | vectorDrawables.useSupportLibrary = true 16 | 17 | consumerProguardFiles("consumer-rules.pro") 18 | } 19 | buildTypes { 20 | getByName("release") { 21 | isMinifyEnabled = false 22 | setProguardFiles( 23 | mutableListOf( 24 | getDefaultProguardFile("proguard-android.txt"), 25 | "proguard-rules.pro" 26 | ) 27 | ) 28 | } 29 | } 30 | 31 | namespace = "com.trendyol.fitoptionmessageview" 32 | 33 | compileOptions { 34 | sourceCompatibility = JavaVersion.VERSION_17 35 | targetCompatibility = JavaVersion.VERSION_17 36 | } 37 | } 38 | 39 | dependencies { 40 | implementation(Dependencies.appCompat) 41 | implementation(Dependencies.coreKtx) 42 | } 43 | -------------------------------------------------------------------------------- /libraries/fit-option-message-view/consumer-rules.pro: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Trendyol/android-ui-components/e98a30ce544f7c016f5a991e816736ea8833949b/libraries/fit-option-message-view/consumer-rules.pro -------------------------------------------------------------------------------- /libraries/fit-option-message-view/proguard-rules.pro: -------------------------------------------------------------------------------- 1 | # Add project specific ProGuard rules here. 2 | # You can control the set of applied configuration files using the 3 | # proguardFiles setting in build.gradle.kts. 4 | # 5 | # For more details, see 6 | # http://developer.android.com/guide/developing/tools/proguard.html 7 | 8 | # If your project uses WebView with JS, uncomment the following 9 | # and specify the fully qualified class name to the JavaScript interface 10 | # class: 11 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview { 12 | # public *; 13 | #} 14 | 15 | # Uncomment this to preserve the line number information for 16 | # debugging stack traces. 17 | #-keepattributes SourceFile,LineNumberTable 18 | 19 | # If you keep the line number information, uncomment this to 20 | # hide the original source file name. 21 | #-renamesourcefileattribute SourceFile -------------------------------------------------------------------------------- /libraries/fit-option-message-view/src/main/res/values/attrs.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /libraries/image-slider/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | -------------------------------------------------------------------------------- /libraries/image-slider/build.gradle.kts: -------------------------------------------------------------------------------- 1 | plugins { 2 | id(Plugins.androidLibrary) 3 | id(Plugins.kotlinAndroid) 4 | id(Plugins.mavenPublish) 5 | } 6 | 7 | kotlin.jvmToolchain(17) 8 | 9 | android { 10 | compileSdk = Configs.compileSdkVersion 11 | buildToolsVersion = Configs.buildToolsVersion 12 | 13 | defaultConfig { 14 | minSdk = Configs.minSdkVersion 15 | vectorDrawables.useSupportLibrary = true 16 | 17 | consumerProguardFiles("consumer-rules.pro") 18 | } 19 | buildTypes { 20 | getByName("release") { 21 | isMinifyEnabled = false 22 | setProguardFiles( 23 | mutableListOf( 24 | getDefaultProguardFile("proguard-android.txt"), 25 | "proguard-rules.pro" 26 | ) 27 | ) 28 | } 29 | } 30 | 31 | buildFeatures.viewBinding = true 32 | namespace = "com.trendyol.uicomponents.imageslider" 33 | 34 | compileOptions { 35 | sourceCompatibility = JavaVersion.VERSION_17 36 | targetCompatibility = JavaVersion.VERSION_17 37 | 38 | } 39 | } 40 | 41 | dependencies { 42 | implementation(Dependencies.appCompat) 43 | implementation(Dependencies.coreKtx) 44 | implementation(Dependencies.circleIndicator) 45 | implementation(Dependencies.constraintLayout) 46 | implementation(Dependencies.glide) 47 | implementation(projects.libraries.touchDelegator) 48 | } 49 | -------------------------------------------------------------------------------- /libraries/image-slider/consumer-rules.pro: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Trendyol/android-ui-components/e98a30ce544f7c016f5a991e816736ea8833949b/libraries/image-slider/consumer-rules.pro -------------------------------------------------------------------------------- /libraries/image-slider/proguard-rules.pro: -------------------------------------------------------------------------------- 1 | # Add project specific ProGuard rules here. 2 | # You can control the set of applied configuration files using the 3 | # proguardFiles setting in build.gradle. 4 | # 5 | # For more details, see 6 | # http://developer.android.com/guide/developing/tools/proguard.html 7 | 8 | # If your project uses WebView with JS, uncomment the following 9 | # and specify the fully qualified class name to the JavaScript interface 10 | # class: 11 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview { 12 | # public *; 13 | #} 14 | 15 | # Uncomment this to preserve the line number information for 16 | # debugging stack traces. 17 | #-keepattributes SourceFile,LineNumberTable 18 | 19 | # If you keep the line number information, uncomment this to 20 | # hide the original source file name. 21 | #-renamesourcefileattribute SourceFile 22 | 23 | -keep public class * implements com.bumptech.glide.module.GlideModule 24 | -keep public class * extends com.bumptech.glide.module.AppGlideModule 25 | -keep public enum com.bumptech.glide.load.ImageHeaderParser$** { 26 | **[] $VALUES; 27 | public *; 28 | } 29 | -------------------------------------------------------------------------------- /libraries/image-slider/src/main/java/com/trendyol/uicomponents/imageslider/HackyViewPager.kt: -------------------------------------------------------------------------------- 1 | package com.trendyol.uicomponents.imageslider 2 | 3 | import android.content.Context 4 | import android.util.AttributeSet 5 | import android.view.MotionEvent 6 | import androidx.core.view.children 7 | import androidx.viewpager.widget.ViewPager 8 | 9 | class HackyViewPager : ViewPager { 10 | 11 | constructor(context: Context) : super(context) 12 | 13 | constructor(context: Context, attrs: AttributeSet?) : super(context, attrs) 14 | 15 | override fun onInterceptTouchEvent(ev: MotionEvent?): Boolean { 16 | return try { 17 | super.onInterceptTouchEvent(ev) 18 | } catch (ex: Exception) { 19 | false 20 | } 21 | } 22 | 23 | override fun onTouchEvent(ev: MotionEvent): Boolean { 24 | return if (currentItem == 0 && childCount == 0) { 25 | false 26 | } else super.onTouchEvent(ev) 27 | } 28 | 29 | override fun onMeasure(widthMeasureSpec: Int, heightMeasureSpec: Int) { 30 | var wrappedHeightMeasureSpec = heightMeasureSpec 31 | 32 | var height = 0 33 | children.forEach { child -> 34 | child.measure(widthMeasureSpec, MeasureSpec.makeMeasureSpec(0, MeasureSpec.UNSPECIFIED)) 35 | val h = child.measuredHeight 36 | if (h > height) height = h 37 | } 38 | 39 | if (height != 0) { 40 | wrappedHeightMeasureSpec = MeasureSpec.makeMeasureSpec(height, MeasureSpec.EXACTLY) 41 | } 42 | 43 | super.onMeasure(widthMeasureSpec, wrappedHeightMeasureSpec) 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /libraries/image-slider/src/main/java/com/trendyol/uicomponents/imageslider/ImageSlider.kt: -------------------------------------------------------------------------------- 1 | package com.trendyol.uicomponents.imageslider 2 | 3 | import android.app.Activity 4 | 5 | interface ImageSlider { 6 | 7 | fun setImageSliderViewListener(imageSliderViewListener: ImageSliderView.ImageSliderViewListener) 8 | 9 | fun setActivityInstance(activity: Activity) 10 | } 11 | -------------------------------------------------------------------------------- /libraries/image-slider/src/main/java/com/trendyol/uicomponents/imageslider/ImageSliderViewState.kt: -------------------------------------------------------------------------------- 1 | package com.trendyol.uicomponents.imageslider 2 | 3 | import android.graphics.Color 4 | import android.view.View 5 | import android.widget.ImageView 6 | import androidx.annotation.ColorInt 7 | 8 | data class ImageSliderViewState( 9 | val imageList: List, 10 | var isImageDynamic: Boolean? = null, 11 | var imageHeight: Int? = null, 12 | var isIndicatorAlwaysVisible: Boolean = false, 13 | val scaleType: ImageView.ScaleType = ImageView.ScaleType.CENTER_CROP, 14 | val cornerRadiusInDp: Double? = null, 15 | @ColorInt val backgroundColor: Int = Color.WHITE 16 | ) { 17 | 18 | fun getIndicatorVisibility(): Int { 19 | return if (isIndicatorAlwaysVisible) { 20 | View.VISIBLE 21 | } else { 22 | if (isMultiImage()) { 23 | View.VISIBLE 24 | } else { 25 | View.GONE 26 | } 27 | } 28 | } 29 | 30 | private fun isMultiImage() = imageList.size.greaterThan(1) 31 | } 32 | -------------------------------------------------------------------------------- /libraries/image-slider/src/main/java/com/trendyol/uicomponents/imageslider/touchdelegator/ZoomWindowTouchListener.kt: -------------------------------------------------------------------------------- 1 | package com.trendyol.uicomponents.imageslider.touchdelegator 2 | 3 | import android.view.MotionEvent 4 | import android.view.Window 5 | import com.trendyol.uicomponents.imageslider.CVFloatingZoomView 6 | import com.trendyol.uicomponents.touchdelegator.WindowTouchListener 7 | 8 | class ZoomWindowTouchListener : WindowTouchListener, CVFloatingZoomView.FloatingZoomListener { 9 | 10 | private var zoomView: CVFloatingZoomView? = null 11 | 12 | override fun onHandlingStart(instance: CVFloatingZoomView?) { 13 | this.zoomView = instance 14 | } 15 | 16 | override fun onHandlingEnd(instance: CVFloatingZoomView?) { 17 | this.zoomView = null 18 | } 19 | 20 | override fun onTouchEvent(window: Window, event: MotionEvent): Boolean { 21 | return zoomView?.originalImage?.let { zoomView?.onTouch(it, event) } ?: false 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /libraries/image-slider/src/main/res/animator/animator_alpha.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 10 | 11 | -------------------------------------------------------------------------------- /libraries/image-slider/src/main/res/drawable/background_indicator.xml: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /libraries/image-slider/src/main/res/drawable/shape_indicator_selected.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /libraries/image-slider/src/main/res/drawable/shape_indicator_unselected.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /libraries/image-slider/src/main/res/layout/view_image.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 14 | 15 | -------------------------------------------------------------------------------- /libraries/image-slider/src/main/res/layout/view_image_slider.xml: -------------------------------------------------------------------------------- 1 | 7 | 8 | 12 | 13 | 32 | 33 | -------------------------------------------------------------------------------- /libraries/image-slider/src/main/res/values/colors.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | #78000000 5 | 6 | #ffffff 7 | #bbbbbb 8 | 9 | -------------------------------------------------------------------------------- /libraries/image-slider/src/main/res/values/dimens.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 16dp 5 | 8dp 6 | 4dp 7 | 16dp 8 | 6dp 9 | 10 | -------------------------------------------------------------------------------- /libraries/phonenumber/build.gradle.kts: -------------------------------------------------------------------------------- 1 | plugins { 2 | id(Plugins.androidLibrary) 3 | id(Plugins.kotlinAndroid) 4 | id(Plugins.kotlinParcelize) 5 | id(Plugins.mavenPublish) 6 | } 7 | 8 | kotlin.jvmToolchain(17) 9 | 10 | android { 11 | compileSdk = Configs.compileSdkVersion 12 | buildToolsVersion = Configs.buildToolsVersion 13 | 14 | defaultConfig { 15 | minSdk = Configs.minSdkVersion 16 | vectorDrawables.useSupportLibrary = true 17 | 18 | consumerProguardFiles("consumer-rules.pro") 19 | } 20 | buildTypes { 21 | getByName("release") { 22 | isMinifyEnabled = false 23 | setProguardFiles( 24 | mutableListOf( 25 | getDefaultProguardFile("proguard-android.txt"), 26 | "proguard-rules.pro" 27 | ) 28 | ) 29 | } 30 | } 31 | 32 | namespace = "com.trendyol.uicomponents.phonenumber" 33 | 34 | compileOptions { 35 | sourceCompatibility = JavaVersion.VERSION_17 36 | targetCompatibility = JavaVersion.VERSION_17 37 | } 38 | } 39 | 40 | dependencies { 41 | implementation(Dependencies.coreKtx) 42 | implementation(Dependencies.material) 43 | } 44 | -------------------------------------------------------------------------------- /libraries/phonenumber/consumer-rules.pro: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Trendyol/android-ui-components/e98a30ce544f7c016f5a991e816736ea8833949b/libraries/phonenumber/consumer-rules.pro -------------------------------------------------------------------------------- /libraries/phonenumber/proguard-rules.pro: -------------------------------------------------------------------------------- 1 | # Add project specific ProGuard rules here. 2 | # You can control the set of applied configuration files using the 3 | # proguardFiles setting in build.gradle. 4 | # 5 | # For more details, see 6 | # http://developer.android.com/guide/developing/tools/proguard.html 7 | 8 | # If your project uses WebView with JS, uncomment the following 9 | # and specify the fully qualified class name to the JavaScript interface 10 | # class: 11 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview { 12 | # public *; 13 | #} 14 | 15 | # Uncomment this to preserve the line number information for 16 | # debugging stack traces. 17 | #-keepattributes SourceFile,LineNumberTable 18 | 19 | # If you keep the line number information, uncomment this to 20 | # hide the original source file name. 21 | #-renamesourcefileattribute SourceFile 22 | -------------------------------------------------------------------------------- /libraries/phonenumber/src/main/java/com/trendyol/uicomponents/phonenumber/PhoneNumberTextInputEditTextViewState.kt: -------------------------------------------------------------------------------- 1 | package com.trendyol.uicomponents.phonenumber 2 | 3 | import android.os.Parcelable 4 | import kotlinx.parcelize.Parcelize 5 | 6 | @Parcelize 7 | data class PhoneNumberTextInputEditTextViewState( 8 | val maskable: Boolean, 9 | val maskCharacter: Char 10 | ) : Parcelable 11 | -------------------------------------------------------------------------------- /libraries/quantity-picker-compose/.gitignore: -------------------------------------------------------------------------------- 1 | /build -------------------------------------------------------------------------------- /libraries/quantity-picker-compose/build.gradle.kts: -------------------------------------------------------------------------------- 1 | plugins { 2 | id(Plugins.androidLibrary) 3 | id(Plugins.kotlinAndroid) 4 | id(Plugins.mavenPublish) 5 | id(Plugins.compose) version "2.0.0" 6 | } 7 | 8 | kotlin.jvmToolchain(17) 9 | 10 | android { 11 | namespace = "com.trendyol.quantitypickercompose" 12 | compileSdk = 33 13 | 14 | defaultConfig { 15 | minSdk = Configs.minSdkVersion 16 | vectorDrawables.useSupportLibrary = true 17 | } 18 | 19 | buildTypes { 20 | getByName("release") { 21 | isMinifyEnabled = false 22 | setProguardFiles( 23 | mutableListOf( 24 | getDefaultProguardFile("proguard-android.txt"), 25 | "proguard-rules.pro" 26 | ) 27 | ) 28 | } 29 | } 30 | buildFeatures { 31 | compose = true 32 | } 33 | 34 | composeOptions { 35 | kotlinCompilerExtensionVersion = Dependencies.kotlinCompilerExtensionVersion 36 | } 37 | } 38 | 39 | dependencies { 40 | 41 | val composeBom = platform(Dependencies.composeBom) 42 | implementation(composeBom) 43 | implementation(Dependencies.composeMaterial) 44 | implementation(Dependencies.composeUiTooling) 45 | implementation(Dependencies.composeCoil) 46 | implementation(Dependencies.composeRuntime) 47 | implementation(Dependencies.composeConstraintLayout) 48 | } -------------------------------------------------------------------------------- /libraries/quantity-picker-compose/consumer-rules.pro: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Trendyol/android-ui-components/e98a30ce544f7c016f5a991e816736ea8833949b/libraries/quantity-picker-compose/consumer-rules.pro -------------------------------------------------------------------------------- /libraries/quantity-picker-compose/proguard-rules.pro: -------------------------------------------------------------------------------- 1 | # Add project specific ProGuard rules here. 2 | # You can control the set of applied configuration files using the 3 | # proguardFiles setting in build.gradle. 4 | # 5 | # For more details, see 6 | # http://developer.android.com/guide/developing/tools/proguard.html 7 | 8 | # If your project uses WebView with JS, uncomment the following 9 | # and specify the fully qualified class name to the JavaScript interface 10 | # class: 11 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview { 12 | # public *; 13 | #} 14 | 15 | # Uncomment this to preserve the line number information for 16 | # debugging stack traces. 17 | #-keepattributes SourceFile,LineNumberTable 18 | 19 | # If you keep the line number information, uncomment this to 20 | # hide the original source file name. 21 | #-renamesourcefileattribute SourceFile -------------------------------------------------------------------------------- /libraries/quantity-picker-compose/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /libraries/quantity-picker-compose/src/main/java/com/trendyol/uicomponents/quantitypicker/QuantityIcons.kt: -------------------------------------------------------------------------------- 1 | package com.trendyol.uicomponents.quantitypicker 2 | 3 | import androidx.annotation.DrawableRes 4 | import androidx.compose.ui.graphics.Color 5 | import com.trendyol.quantitypickercompose.R 6 | 7 | data class QuantityIcons( 8 | @DrawableRes val addIconResId: Int = R.drawable.ic_plus, 9 | @DrawableRes val subtractIconResId: Int = R.drawable.ic_subtract, 10 | @DrawableRes val removeIconResId: Int? = R.drawable.ic_trash, 11 | val iconColor: Color, 12 | val disabledColor: Color, 13 | val addIconBackgroundColor: Color? = null, 14 | ) { 15 | companion object { 16 | val default = QuantityIcons( 17 | addIconResId = R.drawable.ic_plus, 18 | subtractIconResId = R.drawable.ic_subtract, 19 | removeIconResId = R.drawable.ic_trash, 20 | iconColor = QuantityPickerDefaults.defaultColor, 21 | disabledColor = QuantityPickerDefaults.disabledColor 22 | ) 23 | } 24 | } 25 | 26 | 27 | -------------------------------------------------------------------------------- /libraries/quantity-picker-compose/src/main/java/com/trendyol/uicomponents/quantitypicker/QuantityPickerDefaults.kt: -------------------------------------------------------------------------------- 1 | package com.trendyol.uicomponents.quantitypicker 2 | 3 | import androidx.compose.foundation.shape.RoundedCornerShape 4 | import androidx.compose.ui.graphics.Color 5 | import androidx.compose.ui.text.TextStyle 6 | import androidx.compose.ui.text.font.FontFamily 7 | import androidx.compose.ui.text.font.FontWeight 8 | import androidx.compose.ui.unit.dp 9 | import androidx.compose.ui.unit.sp 10 | 11 | object QuantityPickerDefaults { 12 | val defaultColor = Color(0xFF42AF2A) 13 | val disabledColor = Color(0xFF999999) 14 | private val textBackGroundColor = Color(0xFFE1F6DD) 15 | 16 | val quantityPickerShape = QuantityShapeDefaults.circle(defaultColor) 17 | 18 | val quantityTextShape = QuantityShape( 19 | shape = RoundedCornerShape(50), 20 | borderWidth = 0.dp, 21 | borderColor = Color.Unspecified, 22 | backgroundColor = textBackGroundColor 23 | ) 24 | 25 | val quantityTextStyle = TextStyle( 26 | fontFamily = FontFamily.Default, 27 | fontWeight = FontWeight.Bold, 28 | fontSize = 14.sp, 29 | color = defaultColor 30 | ) 31 | } -------------------------------------------------------------------------------- /libraries/quantity-picker-compose/src/main/java/com/trendyol/uicomponents/quantitypicker/QuantityPickerDirection.kt: -------------------------------------------------------------------------------- 1 | package com.trendyol.uicomponents.quantitypicker 2 | 3 | enum class QuantityPickerDirection { 4 | VERTICAL, HORIZONTAL; 5 | } -------------------------------------------------------------------------------- /libraries/quantity-picker-compose/src/main/java/com/trendyol/uicomponents/quantitypicker/QuantityPickerViewData.kt: -------------------------------------------------------------------------------- 1 | package com.trendyol.uicomponents.quantitypicker 2 | 3 | import androidx.compose.ui.graphics.Color 4 | 5 | data class QuantityPickerViewData( 6 | val minQuantity: Int = -1, 7 | val maxQuantity: Int = -1, 8 | val currentQuantity: Int = 0 9 | ) { 10 | fun isAddButtonEnabled(): Boolean { 11 | return (isMaxQuantitySet() && currentQuantity >= maxQuantity).not() 12 | } 13 | 14 | private fun isMaxQuantitySet(): Boolean { 15 | return maxQuantity != -1 16 | } 17 | 18 | fun getAddIconColor( 19 | icons: QuantityIcons, 20 | currentQuantity: Int 21 | ): Color { 22 | val iconColor = if (currentQuantity == 0 && icons.addIconBackgroundColor != null) { 23 | Color.White 24 | } else { 25 | icons.iconColor 26 | } 27 | return if (isAddButtonEnabled()) iconColor else icons.disabledColor 28 | } 29 | 30 | fun getBackgroundColor( 31 | icons: QuantityIcons 32 | ): Color = if (currentQuantity == 0) { 33 | icons.addIconBackgroundColor ?: Color.White 34 | } else Color.White 35 | 36 | 37 | fun isSubtractButtonEnabled(): Boolean { 38 | return (currentQuantity > minQuantity) 39 | } 40 | 41 | fun getSubtractButtonColor(iconTintColor: Color, disableTintColor: Color): Color { 42 | return if (isSubtractButtonEnabled()) iconTintColor else disableTintColor 43 | } 44 | } -------------------------------------------------------------------------------- /libraries/quantity-picker-compose/src/main/java/com/trendyol/uicomponents/quantitypicker/QuantityShape.kt: -------------------------------------------------------------------------------- 1 | package com.trendyol.uicomponents.quantitypicker 2 | 3 | import androidx.compose.foundation.shape.RoundedCornerShape 4 | import androidx.compose.ui.graphics.Color 5 | import androidx.compose.ui.graphics.Shape 6 | import androidx.compose.ui.unit.Dp 7 | import androidx.compose.ui.unit.dp 8 | 9 | data class QuantityShape( 10 | val shape: Shape = RoundedCornerShape(20), 11 | val borderWidth: Dp = 2.dp, 12 | val borderColor: Color = Color.LightGray, 13 | val backgroundColor: Color = Color.White 14 | ) 15 | 16 | object QuantityShapeDefaults { 17 | fun circle( 18 | borderColor: Color, 19 | borderWidth: Dp = 1.2.dp 20 | ) = QuantityShape( 21 | shape = RoundedCornerShape(50), 22 | borderWidth = borderWidth, 23 | borderColor = borderColor 24 | ) 25 | } -------------------------------------------------------------------------------- /libraries/quantity-picker-compose/src/main/java/com/trendyol/uicomponents/quantitypicker/QuantitySubtractIcon.kt: -------------------------------------------------------------------------------- 1 | package com.trendyol.uicomponents.quantitypicker 2 | 3 | import androidx.annotation.DrawableRes 4 | import androidx.compose.animation.Crossfade 5 | import androidx.compose.foundation.clickable 6 | import androidx.compose.foundation.interaction.MutableInteractionSource 7 | import androidx.compose.foundation.layout.padding 8 | import androidx.compose.material.Icon 9 | import androidx.compose.runtime.Composable 10 | import androidx.compose.ui.Modifier 11 | import androidx.compose.ui.graphics.painter.Painter 12 | import androidx.compose.ui.res.painterResource 13 | import androidx.compose.ui.unit.dp 14 | 15 | @Composable 16 | internal fun QuantitySubtractIcon( 17 | icons: QuantityIcons, 18 | quantityData: QuantityPickerViewData, 19 | onSubtractClick: (() -> Unit)?, 20 | currentQuantity: Int 21 | ) { 22 | Crossfade( 23 | label = "subtract", 24 | targetState = getSubtractIconPainter( 25 | subtractIcon = icons.subtractIconResId, 26 | removeIcon = icons.removeIconResId, 27 | currentQuantity = currentQuantity 28 | ) 29 | ) { icon -> 30 | Icon( 31 | painter = icon, 32 | contentDescription = null, 33 | modifier = Modifier 34 | .clickable( 35 | enabled = quantityData.isSubtractButtonEnabled(), 36 | onClick = { onSubtractClick?.invoke() }, 37 | interactionSource = MutableInteractionSource(), 38 | indication = null, 39 | ) 40 | .padding(8.dp), 41 | tint = quantityData.getSubtractButtonColor(icons.iconColor, icons.disabledColor) 42 | ) 43 | } 44 | 45 | } 46 | 47 | @Composable 48 | private fun getSubtractIconPainter( 49 | @DrawableRes subtractIcon: Int, 50 | @DrawableRes removeIcon: Int?, 51 | currentQuantity: Int 52 | ): Painter { 53 | return if (currentQuantity <= 1 && removeIcon != null) { 54 | painterResource(id = removeIcon) 55 | } else { 56 | painterResource(id = subtractIcon) 57 | } 58 | } -------------------------------------------------------------------------------- /libraries/quantity-picker-compose/src/main/res/drawable/ic_plus.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /libraries/quantity-picker-compose/src/main/res/drawable/ic_subtract.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /libraries/quantity-picker-compose/src/main/res/drawable/ic_trash.xml: -------------------------------------------------------------------------------- 1 | 6 | 10 | 11 | -------------------------------------------------------------------------------- /libraries/quantity-picker-view/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | -------------------------------------------------------------------------------- /libraries/quantity-picker-view/build.gradle.kts: -------------------------------------------------------------------------------- 1 | plugins { 2 | id(Plugins.androidLibrary) 3 | id(Plugins.kotlinAndroid) 4 | id(Plugins.mavenPublish) 5 | } 6 | 7 | kotlin.jvmToolchain(17) 8 | 9 | android { 10 | compileSdk = Configs.compileSdkVersion 11 | buildToolsVersion = Configs.buildToolsVersion 12 | 13 | defaultConfig { 14 | minSdk = Configs.minSdkVersion 15 | vectorDrawables.useSupportLibrary = true 16 | 17 | consumerProguardFiles("consumer-rules.pro") 18 | } 19 | buildTypes { 20 | getByName("release") { 21 | isMinifyEnabled = false 22 | setProguardFiles( 23 | mutableListOf( 24 | getDefaultProguardFile("proguard-android.txt"), 25 | "proguard-rules.pro" 26 | ) 27 | ) 28 | } 29 | } 30 | 31 | buildFeatures.viewBinding = true 32 | namespace = "com.trendyol.uicomponents.quantitypickerview" 33 | 34 | compileOptions { 35 | sourceCompatibility = JavaVersion.VERSION_17 36 | targetCompatibility = JavaVersion.VERSION_17 37 | } 38 | } 39 | 40 | dependencies { 41 | implementation(Dependencies.appCompat) 42 | implementation(Dependencies.coreKtx) 43 | implementation(Dependencies.material) 44 | implementation(Dependencies.constraintLayout) 45 | implementation(Dependencies.lifecycleExtensions) 46 | } 47 | -------------------------------------------------------------------------------- /libraries/quantity-picker-view/consumer-rules.pro: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Trendyol/android-ui-components/e98a30ce544f7c016f5a991e816736ea8833949b/libraries/quantity-picker-view/consumer-rules.pro -------------------------------------------------------------------------------- /libraries/quantity-picker-view/proguard-rules.pro: -------------------------------------------------------------------------------- 1 | # Add project specific ProGuard rules here. 2 | # You can control the set of applied configuration files using the 3 | # proguardFiles setting in build.gradle. 4 | # 5 | # For more details, see 6 | # http://developer.android.com/guide/developing/tools/proguard.html 7 | 8 | # If your project uses WebView with JS, uncomment the following 9 | # and specify the fully qualified class name to the JavaScript interface 10 | # class: 11 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview { 12 | # public *; 13 | #} 14 | 15 | # Uncomment this to preserve the line number information for 16 | # debugging stack traces. 17 | #-keepattributes SourceFile,LineNumberTable 18 | 19 | # If you keep the line number information, uncomment this to 20 | # hide the original source file name. 21 | #-renamesourcefileattribute SourceFile 22 | -keep class com.trendyol.uicomponents.quantitypickerview.QuantityPickerView { *; } 23 | -keep class com.trendyol.uicomponents.quantitypickerview.QuantityPickerViewState { *; } 24 | -------------------------------------------------------------------------------- /libraries/quantity-picker-view/src/main/java/com/trendyol/uicomponents/quantitypickerview/BindingAdapters.kt: -------------------------------------------------------------------------------- 1 | package com.trendyol.uicomponents.quantitypickerview 2 | 3 | import android.graphics.Typeface 4 | import android.util.TypedValue 5 | import androidx.appcompat.widget.AppCompatTextView 6 | import androidx.core.content.res.ResourcesCompat 7 | 8 | 9 | internal fun AppCompatTextView.setTextAppearance( 10 | quantityPickerTextAppearance: QuantityPickerTextAppearance 11 | ) { 12 | val style = when (quantityPickerTextAppearance.textStyle) { 13 | 0 -> Typeface.NORMAL 14 | 1 -> Typeface.BOLD 15 | 2 -> Typeface.ITALIC 16 | else -> throw IllegalArgumentException("no style attribute") 17 | } 18 | setTypeface(typeface, style) 19 | setTextSize(TypedValue.COMPLEX_UNIT_PX, quantityPickerTextAppearance.textSize.toFloat()) 20 | setTextColor(quantityPickerTextAppearance.textColor) 21 | 22 | //or to support all versions use 23 | if (quantityPickerTextAppearance.textFontFamily != -1 && quantityPickerTextAppearance.textFontFamily != null) { 24 | val typeface = ResourcesCompat.getFont(context, quantityPickerTextAppearance.textFontFamily) 25 | setTypeface(typeface) 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /libraries/quantity-picker-view/src/main/java/com/trendyol/uicomponents/quantitypickerview/Extensions.kt: -------------------------------------------------------------------------------- 1 | package com.trendyol.uicomponents.quantitypickerview 2 | 3 | import android.content.Context 4 | import android.util.TypedValue 5 | import androidx.annotation.AttrRes 6 | 7 | internal fun Context.asSP(value: Int): Int = 8 | (value * resources.displayMetrics.scaledDensity).toInt() 9 | 10 | internal fun Context.asDP(value: Int): Int = 11 | (value * resources.displayMetrics.density).toInt() 12 | 13 | internal fun Context.themeColor(@AttrRes attrRes: Int): Int { 14 | val typedValue = TypedValue() 15 | theme.resolveAttribute(attrRes, typedValue, true) 16 | return typedValue.data 17 | } 18 | -------------------------------------------------------------------------------- /libraries/quantity-picker-view/src/main/java/com/trendyol/uicomponents/quantitypickerview/QuantityPickerTextAppearance.kt: -------------------------------------------------------------------------------- 1 | package com.trendyol.uicomponents.quantitypickerview 2 | 3 | import androidx.annotation.ColorInt 4 | import androidx.annotation.FontRes 5 | 6 | data class QuantityPickerTextAppearance( 7 | @ColorInt val textColor: Int, 8 | val textSize: Int, 9 | val textStyle: Int, 10 | @FontRes val textFontFamily: Int? 11 | ) 12 | -------------------------------------------------------------------------------- /libraries/quantity-picker-view/src/main/res/drawable/qpv_ic_default_add.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 12 | 13 | -------------------------------------------------------------------------------- /libraries/quantity-picker-view/src/main/res/drawable/qpv_ic_default_add_disabled.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 12 | 13 | -------------------------------------------------------------------------------- /libraries/quantity-picker-view/src/main/res/drawable/qpv_ic_default_remove.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 12 | 13 | -------------------------------------------------------------------------------- /libraries/quantity-picker-view/src/main/res/drawable/qpv_ic_default_subtract.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /libraries/quantity-picker-view/src/main/res/drawable/qpv_ic_default_subtract_disabled.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /libraries/quantity-picker-view/src/main/res/drawable/qpv_shape_default_background.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /libraries/quantity-picker-view/src/main/res/values/attrs.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | -------------------------------------------------------------------------------- /libraries/quantity-picker-view/src/main/res/values/dimens.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 8dp 4 | 16dp 5 | 4dp 6 | -------------------------------------------------------------------------------- /libraries/rating-bar-compose/.gitignore: -------------------------------------------------------------------------------- 1 | /build -------------------------------------------------------------------------------- /libraries/rating-bar-compose/build.gradle.kts: -------------------------------------------------------------------------------- 1 | plugins { 2 | id(Plugins.androidLibrary) 3 | id(Plugins.kotlinAndroid) 4 | id(Plugins.mavenPublish) 5 | id(Plugins.compose) version "2.0.0" 6 | } 7 | 8 | kotlin.jvmToolchain(17) 9 | 10 | android { 11 | namespace = "com.trendyol.ratingbarcompose" 12 | compileSdk = 33 13 | 14 | defaultConfig { 15 | minSdk = Configs.minSdkVersion 16 | vectorDrawables.useSupportLibrary = true 17 | } 18 | 19 | buildTypes { 20 | getByName("release") { 21 | isMinifyEnabled = false 22 | setProguardFiles( 23 | mutableListOf( 24 | getDefaultProguardFile("proguard-android.txt"), 25 | "proguard-rules.pro" 26 | ) 27 | ) 28 | } 29 | } 30 | buildFeatures { 31 | compose = true 32 | } 33 | 34 | composeOptions { 35 | kotlinCompilerExtensionVersion = Dependencies.kotlinCompilerExtensionVersion 36 | } 37 | } 38 | 39 | dependencies { 40 | 41 | val composeBom = platform(Dependencies.composeBom) 42 | implementation(composeBom) 43 | implementation(Dependencies.composeMaterial) 44 | implementation(Dependencies.composeUiTooling) 45 | implementation(Dependencies.composeCoil) 46 | implementation(Dependencies.composeRuntime) 47 | implementation(Dependencies.composeConstraintLayout) 48 | } -------------------------------------------------------------------------------- /libraries/rating-bar-compose/consumer-rules.pro: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Trendyol/android-ui-components/e98a30ce544f7c016f5a991e816736ea8833949b/libraries/rating-bar-compose/consumer-rules.pro -------------------------------------------------------------------------------- /libraries/rating-bar-compose/proguard-rules.pro: -------------------------------------------------------------------------------- 1 | # Add project specific ProGuard rules here. 2 | # You can control the set of applied configuration files using the 3 | # proguardFiles setting in build.gradle. 4 | # 5 | # For more details, see 6 | # http://developer.android.com/guide/developing/tools/proguard.html 7 | 8 | # If your project uses WebView with JS, uncomment the following 9 | # and specify the fully qualified class name to the JavaScript interface 10 | # class: 11 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview { 12 | # public *; 13 | #} 14 | 15 | # Uncomment this to preserve the line number information for 16 | # debugging stack traces. 17 | #-keepattributes SourceFile,LineNumberTable 18 | 19 | # If you keep the line number information, uncomment this to 20 | # hide the original source file name. 21 | #-renamesourcefileattribute SourceFile -------------------------------------------------------------------------------- /libraries/rating-bar-compose/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /libraries/rating-bar-compose/src/main/res/drawable/ic_star.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /libraries/rating-bar/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | -------------------------------------------------------------------------------- /libraries/rating-bar/build.gradle.kts: -------------------------------------------------------------------------------- 1 | plugins { 2 | id(Plugins.androidLibrary) 3 | id(Plugins.kotlinAndroid) 4 | id(Plugins.mavenPublish) 5 | } 6 | 7 | kotlin.jvmToolchain(17) 8 | 9 | android { 10 | compileSdk = Configs.compileSdkVersion 11 | buildToolsVersion = Configs.buildToolsVersion 12 | 13 | defaultConfig { 14 | minSdk = Configs.minSdkVersion 15 | vectorDrawables.useSupportLibrary = true 16 | 17 | consumerProguardFiles("consumer-rules.pro") 18 | } 19 | buildTypes { 20 | getByName("release") { 21 | isMinifyEnabled = false 22 | setProguardFiles( 23 | mutableListOf( 24 | getDefaultProguardFile("proguard-android.txt"), 25 | "proguard-rules.pro" 26 | ) 27 | ) 28 | } 29 | } 30 | 31 | namespace = "com.trendyol.uicomponents.ratingbar" 32 | buildFeatures.viewBinding = true 33 | 34 | compileOptions { 35 | sourceCompatibility = JavaVersion.VERSION_17 36 | targetCompatibility = JavaVersion.VERSION_17 37 | } 38 | } 39 | 40 | dependencies { 41 | implementation(Dependencies.appCompat) 42 | } 43 | -------------------------------------------------------------------------------- /libraries/rating-bar/consumer-rules.pro: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Trendyol/android-ui-components/e98a30ce544f7c016f5a991e816736ea8833949b/libraries/rating-bar/consumer-rules.pro -------------------------------------------------------------------------------- /libraries/rating-bar/proguard-rules.pro: -------------------------------------------------------------------------------- 1 | # Add project specific ProGuard rules here. 2 | # You can control the set of applied configuration files using the 3 | # proguardFiles setting in build.gradle. 4 | # 5 | # For more details, see 6 | # http://developer.android.com/guide/developing/tools/proguard.html 7 | 8 | # If your project uses WebView with JS, uncomment the following 9 | # and specify the fully qualified class name to the JavaScript interface 10 | # class: 11 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview { 12 | # public *; 13 | #} 14 | 15 | # Uncomment this to preserve the line number information for 16 | # debugging stack traces. 17 | #-keepattributes SourceFile,LineNumberTable 18 | 19 | # If you keep the line number information, uncomment this to 20 | # hide the original source file name. 21 | #-renamesourcefileattribute SourceFile 22 | -------------------------------------------------------------------------------- /libraries/rating-bar/src/main/java/com/trendyol/uicomponents/ratingbar/Extensions.kt: -------------------------------------------------------------------------------- 1 | package com.trendyol.uicomponents.ratingbar 2 | 3 | import android.content.Context 4 | import android.widget.ImageView 5 | import androidx.annotation.ColorInt 6 | import androidx.annotation.ColorRes 7 | import androidx.core.content.ContextCompat 8 | import androidx.core.graphics.drawable.DrawableCompat 9 | 10 | @ColorInt 11 | internal fun Context.color(@ColorRes colorResId: Int): Int = 12 | ContextCompat.getColor(this, colorResId) 13 | 14 | internal fun ImageView.setTintCompat(@ColorInt tint: Int) { 15 | drawable.mutate() 16 | DrawableCompat.setTint(drawable, tint) 17 | } 18 | -------------------------------------------------------------------------------- /libraries/rating-bar/src/main/java/com/trendyol/uicomponents/ratingbar/RatingBarViewState.kt: -------------------------------------------------------------------------------- 1 | package com.trendyol.uicomponents.ratingbar 2 | 3 | import androidx.annotation.ColorInt 4 | 5 | data class RatingBarViewState( 6 | private val starCount: Int, 7 | @ColorInt private val starHighlightColor: Int, 8 | @ColorInt private val starDefaultColor: Int 9 | ) { 10 | 11 | fun getTint1(): Int = if (1 <= starCount) starHighlightColor else starDefaultColor 12 | 13 | fun getTint2(): Int = if (2 <= starCount) starHighlightColor else starDefaultColor 14 | 15 | fun getTint3(): Int = if (3 <= starCount) starHighlightColor else starDefaultColor 16 | 17 | fun getTint4(): Int = if (4 <= starCount) starHighlightColor else starDefaultColor 18 | 19 | fun getTint5(): Int = if (5 <= starCount) starHighlightColor else starDefaultColor 20 | } 21 | -------------------------------------------------------------------------------- /libraries/rating-bar/src/main/res/drawable/ic_star.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /libraries/rating-bar/src/main/res/layout/view_rating_bar.xml: -------------------------------------------------------------------------------- 1 | 2 | 9 | 10 | 18 | 19 | 27 | 28 | 36 | 37 | 45 | 46 | 53 | 54 | -------------------------------------------------------------------------------- /libraries/rating-bar/src/main/res/values/attrs.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /libraries/rating-bar/src/main/res/values/colors.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | #ffc000 5 | #e6e6e6 6 | 7 | -------------------------------------------------------------------------------- /libraries/rating-bar/src/main/res/values/dimens.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 2dp 5 | 6 | -------------------------------------------------------------------------------- /libraries/suggestion-input-view/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | -------------------------------------------------------------------------------- /libraries/suggestion-input-view/build.gradle.kts: -------------------------------------------------------------------------------- 1 | plugins { 2 | id(Plugins.androidLibrary) 3 | id(Plugins.kotlinAndroid) 4 | id(Plugins.kotlinKapt) 5 | id(Plugins.mavenPublish) 6 | } 7 | 8 | kotlin.jvmToolchain(17) 9 | 10 | android { 11 | compileSdk = Configs.compileSdkVersion 12 | buildToolsVersion = Configs.buildToolsVersion 13 | 14 | defaultConfig { 15 | minSdk = Configs.minSdkVersion 16 | vectorDrawables.useSupportLibrary = true 17 | 18 | consumerProguardFiles("consumer-rules.pro") 19 | } 20 | buildTypes { 21 | getByName("release") { 22 | isMinifyEnabled = false 23 | setProguardFiles( 24 | mutableListOf( 25 | getDefaultProguardFile("proguard-android.txt"), 26 | "proguard-rules.pro" 27 | ) 28 | ) 29 | } 30 | } 31 | 32 | namespace = "com.trendyol.suggestioninputview" 33 | buildFeatures.viewBinding = true 34 | 35 | compileOptions { 36 | sourceCompatibility = JavaVersion.VERSION_17 37 | targetCompatibility = JavaVersion.VERSION_17 38 | } 39 | } 40 | 41 | dependencies { 42 | implementation(Dependencies.appCompat) 43 | implementation(Dependencies.coreKtx) 44 | implementation(Dependencies.recyclerView) 45 | implementation(Dependencies.constraintLayout) 46 | } 47 | -------------------------------------------------------------------------------- /libraries/suggestion-input-view/consumer-rules.pro: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Trendyol/android-ui-components/e98a30ce544f7c016f5a991e816736ea8833949b/libraries/suggestion-input-view/consumer-rules.pro -------------------------------------------------------------------------------- /libraries/suggestion-input-view/proguard-rules.pro: -------------------------------------------------------------------------------- 1 | # Add project specific ProGuard rules here. 2 | # You can control the set of applied configuration files using the 3 | # proguardFiles setting in build.gradle. 4 | # 5 | # For more details, see 6 | # http://developer.android.com/guide/developing/tools/proguard.html 7 | 8 | # If your project uses WebView with JS, uncomment the following 9 | # and specify the fully qualified class name to the JavaScript interface 10 | # class: 11 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview { 12 | # public *; 13 | #} 14 | 15 | # Uncomment this to preserve the line number information for 16 | # debugging stack traces. 17 | #-keepattributes SourceFile,LineNumberTable 18 | 19 | # If you keep the line number information, uncomment this to 20 | # hide the original source file name. 21 | #-renamesourcefileattribute SourceFile 22 | -------------------------------------------------------------------------------- /libraries/suggestion-input-view/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /libraries/suggestion-input-view/src/main/java/com/trendyol/suggestioninputview/Extensions.kt: -------------------------------------------------------------------------------- 1 | package com.trendyol.suggestioninputview 2 | 3 | import android.content.Context 4 | import android.graphics.drawable.Drawable 5 | import android.view.View 6 | import android.view.inputmethod.InputMethodManager 7 | import androidx.annotation.ColorInt 8 | import androidx.annotation.ColorRes 9 | import androidx.annotation.DrawableRes 10 | import androidx.core.content.ContextCompat 11 | 12 | @ColorInt 13 | internal fun Context.color(@ColorRes colorResId: Int): Int = 14 | ContextCompat.getColor(this, colorResId) 15 | 16 | internal fun Context.drawable(@DrawableRes drawableResId: Int): Drawable? = 17 | ContextCompat.getDrawable(this, drawableResId) 18 | 19 | fun View.hideKeyboard() { 20 | val imm = context.getSystemService(Context.INPUT_METHOD_SERVICE) as InputMethodManager 21 | imm.hideSoftInputFromWindow(windowToken, 0) 22 | } 23 | 24 | fun View.showKeyboard() { 25 | val imm = context.getSystemService(Context.INPUT_METHOD_SERVICE) as InputMethodManager 26 | imm.showSoftInput(this, InputMethodManager.SHOW_IMPLICIT) 27 | } 28 | -------------------------------------------------------------------------------- /libraries/suggestion-input-view/src/main/java/com/trendyol/suggestioninputview/Rule.kt: -------------------------------------------------------------------------------- 1 | package com.trendyol.suggestioninputview 2 | 3 | class Rule(val type: RuleTypes?, val value: String?, val errorMessage: String?) { 4 | 5 | data class Builder( 6 | var type: RuleTypes? = null, 7 | var value: String? = null, 8 | var errorMessage: String? = null 9 | ) { 10 | fun biggerThan(value: String) = apply { 11 | this.type = RuleTypes.MUST_BIGGER 12 | this.value = value 13 | } 14 | 15 | fun smallerThan(value: String) = apply { 16 | this.type = RuleTypes.MUST_SMALL 17 | this.value = value 18 | } 19 | 20 | fun equalsTo(value: String) = apply { 21 | this.type = RuleTypes.MUST_EQUALS 22 | this.value = value 23 | } 24 | 25 | fun notEqualsTo(value: String) = apply { 26 | this.type = RuleTypes.MUST_NOT_EQUALS 27 | this.value = value 28 | } 29 | 30 | fun errorMessage(message: String) = apply { 31 | this.errorMessage = message 32 | } 33 | 34 | fun build(): Rule = Rule(type, value, errorMessage) 35 | } 36 | } 37 | 38 | enum class RuleTypes { 39 | MUST_SMALL, MUST_BIGGER, MUST_EQUALS, MUST_NOT_EQUALS 40 | } -------------------------------------------------------------------------------- /libraries/suggestion-input-view/src/main/java/com/trendyol/suggestioninputview/RuleValidator.kt: -------------------------------------------------------------------------------- 1 | package com.trendyol.suggestioninputview 2 | 3 | object RuleValidator { 4 | 5 | fun validate(rules: List?, value: String): Pair { 6 | var valid = true 7 | var invalidRule: Rule? = null 8 | 9 | if (rules == null) valid = true 10 | rules?.forEach { rule -> 11 | when (rule.type) { 12 | RuleTypes.MUST_BIGGER -> { 13 | if ((rule.value?.toDoubleOrNull() ?: 0.0) > (value.toDoubleOrNull() ?: 0.0)) { 14 | invalidRule = rule 15 | valid = false 16 | } 17 | } 18 | RuleTypes.MUST_SMALL -> { 19 | if ((rule.value?.toDoubleOrNull() ?: 0.0) < (value.toDoubleOrNull() ?: 0.0)) { 20 | invalidRule = rule 21 | valid = false 22 | } 23 | } 24 | RuleTypes.MUST_EQUALS -> { 25 | if ((rule.value?.toDoubleOrNull() ?: 0.0) != (value.toDoubleOrNull() ?: 0.0)) { 26 | invalidRule = rule 27 | valid = false 28 | } 29 | } 30 | RuleTypes.MUST_NOT_EQUALS -> { 31 | if ((rule.value?.toDoubleOrNull() ?: 0.0) == (value.toDoubleOrNull() ?: 0.0)) { 32 | invalidRule = rule 33 | valid = false 34 | } 35 | } 36 | null -> { 37 | // do nothing 38 | } 39 | } 40 | } 41 | return Pair(valid, invalidRule) 42 | } 43 | } -------------------------------------------------------------------------------- /libraries/suggestion-input-view/src/main/java/com/trendyol/suggestioninputview/SuggestionInputBadge.kt: -------------------------------------------------------------------------------- 1 | package com.trendyol.suggestioninputview 2 | 3 | import android.graphics.drawable.Drawable 4 | import androidx.annotation.ColorInt 5 | import androidx.annotation.Dimension 6 | 7 | data class SuggestionInputBadge( 8 | val text: String = "", 9 | val background: Drawable?, 10 | @ColorInt val textColor: Int, 11 | @Dimension val textSize: Float, 12 | @Dimension val horizontalPadding: Float, 13 | @Dimension val verticalPadding: Float 14 | ) 15 | -------------------------------------------------------------------------------- /libraries/suggestion-input-view/src/main/java/com/trendyol/suggestioninputview/SuggestionInputEditText.kt: -------------------------------------------------------------------------------- 1 | package com.trendyol.suggestioninputview 2 | 3 | import android.content.Context 4 | import android.graphics.Canvas 5 | import android.graphics.Rect 6 | import android.util.AttributeSet 7 | import androidx.appcompat.widget.AppCompatEditText 8 | 9 | internal class SuggestionInputEditText : AppCompatEditText { 10 | 11 | constructor(context: Context) : super(context) 12 | 13 | constructor(context: Context, attrs: AttributeSet?) : super(context, attrs) 14 | 15 | constructor(context: Context, attrs: AttributeSet?, defStyleAttr: Int) : super( 16 | context, 17 | attrs, 18 | defStyleAttr 19 | ) 20 | 21 | private var suffix = "" 22 | private var isSuffixVisible: Boolean = false 23 | private val suffixPaddingLeft = 24 | resources.getDimensionPixelSize(R.dimen.horizontal_padding_suggestion_item) 25 | 26 | fun setSuffix(suffix: String) { 27 | this.suffix = suffix 28 | } 29 | 30 | fun setSuffixVisible(isActive: Boolean) { 31 | isSuffixVisible = isActive 32 | } 33 | 34 | override fun onDraw(canvas: Canvas) { 35 | super.onDraw(canvas) 36 | if(isSuffixVisible.not() && text?.isEmpty() == true) return 37 | val suffixWidth: Float = paint.measureText(suffix) / 2 38 | val textWidth: Float = paint.measureText(text.toString()) + suffixPaddingLeft 39 | canvas.drawText(suffix, textWidth + suffixWidth, baseline.toFloat(), paint) 40 | } 41 | } -------------------------------------------------------------------------------- /libraries/suggestion-input-view/src/main/java/com/trendyol/suggestioninputview/SuggestionInputItem.kt: -------------------------------------------------------------------------------- 1 | package com.trendyol.suggestioninputview 2 | 3 | data class SuggestionInputItem( 4 | val id: Int, 5 | val text: String, 6 | val value: String, 7 | val isSelected: Boolean, 8 | val type: SuggestionItemType, 9 | val suffix: String = "", 10 | val badgeText: String = "" 11 | ) -------------------------------------------------------------------------------- /libraries/suggestion-input-view/src/main/java/com/trendyol/suggestioninputview/SuggestionInputViewState.kt: -------------------------------------------------------------------------------- 1 | package com.trendyol.suggestioninputview 2 | 3 | import android.graphics.drawable.Drawable 4 | import android.view.View 5 | import androidx.annotation.ColorInt 6 | import androidx.annotation.Dimension 7 | 8 | data class SuggestionInputViewState( 9 | val items: List, 10 | val buttonBackground: Drawable?, 11 | val editTextBackground: Drawable?, 12 | val editTextErrorBackground: Drawable?, 13 | @ColorInt val buttonTextColor: Int, 14 | @Dimension val textSize: Float, 15 | val buttonText: String, 16 | val verticalPadding: Float, 17 | val suffix: String, 18 | val inputType: Int, 19 | val shouldShowInputItemError: Boolean, 20 | val inputErrorMessage: String, 21 | val hint: String 22 | ) { 23 | fun getInputBackground(): Drawable? = 24 | if(shouldShowInputItemError) { 25 | editTextErrorBackground 26 | } else { 27 | editTextBackground 28 | } 29 | 30 | fun getMinWidth(): Int = items.firstOrNull()?.getMinimumWidth() ?: 0 31 | 32 | fun getErrorTextVisibility(): Int = if(shouldShowInputItemError) View.VISIBLE else View.GONE 33 | 34 | fun getErrorText(): String = inputErrorMessage 35 | 36 | fun isSuffixVisible(): Boolean = hint.isEmpty() && suffix.isNotEmpty() 37 | 38 | fun getVerticalPadding(): Int = verticalPadding.toInt() 39 | } -------------------------------------------------------------------------------- /libraries/suggestion-input-view/src/main/java/com/trendyol/suggestioninputview/SuggestionItemType.kt: -------------------------------------------------------------------------------- 1 | package com.trendyol.suggestioninputview 2 | 3 | enum class SuggestionItemType { 4 | SELECTABLE, INPUT 5 | } -------------------------------------------------------------------------------- /libraries/suggestion-input-view/src/main/res/drawable/ic_arrow_back.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | -------------------------------------------------------------------------------- /libraries/suggestion-input-view/src/main/res/drawable/shape_background_suggestion_item_badge.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /libraries/suggestion-input-view/src/main/res/drawable/shape_error_background_suggestion_item.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /libraries/suggestion-input-view/src/main/res/drawable/shape_selected_background_suggestion_item.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /libraries/suggestion-input-view/src/main/res/drawable/shape_unselected_background_suggestion_item.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /libraries/suggestion-input-view/src/main/res/layout/item_suggestion.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 20 | 21 | 29 | 30 | -------------------------------------------------------------------------------- /libraries/suggestion-input-view/src/main/res/values/colors.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | #333333 4 | #ffffff 5 | #333333 6 | #f27a1a 7 | #fef1e8 8 | -------------------------------------------------------------------------------- /libraries/suggestion-input-view/src/main/res/values/dimens.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 14sp 4 | 10sp 5 | 4dp 6 | 8dp 7 | 80dp 8 | 16dp 9 | 16dp 10 | 2dp 11 | 6dp 12 | 8dp 13 | 2dp 14 | 10dp 15 | -------------------------------------------------------------------------------- /libraries/timeline-view-compose/.gitignore: -------------------------------------------------------------------------------- 1 | /build -------------------------------------------------------------------------------- /libraries/timeline-view-compose/build.gradle.kts: -------------------------------------------------------------------------------- 1 | plugins { 2 | id(Plugins.androidLibrary) 3 | id(Plugins.kotlinAndroid) 4 | id(Plugins.mavenPublish) 5 | id(Plugins.compose) version "2.0.0" 6 | } 7 | 8 | kotlin.jvmToolchain(17) 9 | 10 | android { 11 | namespace = "com.trendyol.timelineviewcompose" 12 | compileSdk = 33 13 | 14 | defaultConfig { 15 | minSdk = Configs.minSdkVersion 16 | vectorDrawables.useSupportLibrary = true 17 | } 18 | 19 | tasks.withType { 20 | compilerOptions.freeCompilerArgs.addAll( 21 | "-P", 22 | "plugin:androidx.compose.compiler.plugins.kotlin:experimentalStrongSkipping=true", 23 | ) 24 | } 25 | 26 | 27 | buildTypes { 28 | getByName("release") { 29 | isMinifyEnabled = false 30 | setProguardFiles( 31 | mutableListOf( 32 | getDefaultProguardFile("proguard-android.txt"), 33 | "proguard-rules.pro" 34 | ) 35 | ) 36 | } 37 | } 38 | buildFeatures { 39 | compose = true 40 | } 41 | 42 | composeOptions { 43 | kotlinCompilerExtensionVersion = Dependencies.kotlinCompilerExtensionVersion 44 | } 45 | } 46 | 47 | dependencies { 48 | 49 | val composeBom = platform(Dependencies.composeBom) 50 | implementation(composeBom) 51 | implementation(Dependencies.composeMaterial) 52 | implementation(Dependencies.composeUiTooling) 53 | implementation(Dependencies.composeCoil) 54 | implementation(Dependencies.composeRuntime) 55 | implementation(Dependencies.composeConstraintLayout) 56 | } -------------------------------------------------------------------------------- /libraries/timeline-view-compose/consumer-rules.pro: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Trendyol/android-ui-components/e98a30ce544f7c016f5a991e816736ea8833949b/libraries/timeline-view-compose/consumer-rules.pro -------------------------------------------------------------------------------- /libraries/timeline-view-compose/proguard-rules.pro: -------------------------------------------------------------------------------- 1 | # Add project specific ProGuard rules here. 2 | # You can control the set of applied configuration files using the 3 | # proguardFiles setting in build.gradle. 4 | # 5 | # For more details, see 6 | # http://developer.android.com/guide/developing/tools/proguard.html 7 | 8 | # If your project uses WebView with JS, uncomment the following 9 | # and specify the fully qualified class name to the JavaScript interface 10 | # class: 11 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview { 12 | # public *; 13 | #} 14 | 15 | # Uncomment this to preserve the line number information for 16 | # debugging stack traces. 17 | #-keepattributes SourceFile,LineNumberTable 18 | 19 | # If you keep the line number information, uncomment this to 20 | # hide the original source file name. 21 | #-renamesourcefileattribute SourceFile -------------------------------------------------------------------------------- /libraries/timeline-view-compose/src/main/java/com/trendyol/uicomponents/timelineviewcompose/ScaleAnimation.kt: -------------------------------------------------------------------------------- 1 | package com.trendyol.uicomponents.timelineviewcompose 2 | 3 | import androidx.compose.animation.core.animateFloat 4 | import androidx.compose.animation.core.rememberInfiniteTransition 5 | import androidx.compose.runtime.LaunchedEffect 6 | import androidx.compose.runtime.Stable 7 | import androidx.compose.runtime.getValue 8 | import androidx.compose.runtime.mutableStateOf 9 | import androidx.compose.runtime.remember 10 | import androidx.compose.runtime.setValue 11 | import androidx.compose.ui.Modifier 12 | import androidx.compose.ui.composed 13 | import androidx.compose.ui.graphics.graphicsLayer 14 | import com.trendyol.uicomponents.timelineviewcompose.model.PointAnimation 15 | import kotlinx.coroutines.delay 16 | 17 | @Stable 18 | internal fun Modifier.scaleAnimation(pointAnimation: PointAnimation?) = composed { 19 | 20 | if (pointAnimation == null) return@composed this 21 | 22 | var shouldStartAnimation by remember { mutableStateOf(false) } 23 | val infiniteTransition = rememberInfiniteTransition() 24 | val pointScale = if (shouldStartAnimation) { 25 | infiniteTransition.animateFloat( 26 | initialValue = pointAnimation.initialValue, 27 | targetValue = pointAnimation.targetValue, 28 | animationSpec = pointAnimation.animationSpec, 29 | ) 30 | } else null 31 | 32 | LaunchedEffect(Unit) { 33 | delay(pointAnimation.startDelay.toLong()) 34 | shouldStartAnimation = true 35 | } 36 | 37 | graphicsLayer { 38 | pointScale?.value?.let { 39 | scaleX = it 40 | scaleY = it 41 | } 42 | } 43 | } -------------------------------------------------------------------------------- /libraries/timeline-view-compose/src/main/java/com/trendyol/uicomponents/timelineviewcompose/model/ImageConfig.kt: -------------------------------------------------------------------------------- 1 | package com.trendyol.uicomponents.timelineviewcompose.model 2 | 3 | import androidx.compose.runtime.Immutable 4 | import androidx.compose.ui.graphics.painter.Painter 5 | import androidx.compose.ui.unit.Dp 6 | 7 | @Immutable 8 | data class ImageConfig( 9 | val imageUrl: String, 10 | val placeholder: Painter? = null, 11 | val borderWidth: Dp = TimelineViewDefaults.BorderWidth, 12 | val size: Dp = TimelineViewDefaults.ItemSize, 13 | val animation: PointAnimation? = null, 14 | ) -------------------------------------------------------------------------------- /libraries/timeline-view-compose/src/main/java/com/trendyol/uicomponents/timelineviewcompose/model/LineConfig.kt: -------------------------------------------------------------------------------- 1 | package com.trendyol.uicomponents.timelineviewcompose.model 2 | 3 | import androidx.compose.runtime.Immutable 4 | import androidx.compose.ui.graphics.Color 5 | import androidx.compose.ui.graphics.StrokeCap 6 | import androidx.compose.ui.unit.Dp 7 | 8 | @Immutable 9 | data class LineConfig( 10 | val strokeCap: StrokeCap = StrokeCap.Butt, 11 | val color: Color, 12 | val size: Dp = TimelineViewDefaults.LineSize, 13 | val thickness: Dp = TimelineViewDefaults.LineThickness, 14 | val lineType: LineType = LineType.Solid, 15 | val animation: LineAnimation? = null, 16 | ) 17 | 18 | @Immutable 19 | sealed class LineType { 20 | object Solid : LineType() 21 | 22 | class Dashed( 23 | val intervals: FloatArray = floatArrayOf(20f, 20f), 24 | val phase: Float = 30f, 25 | ) : LineType() 26 | } 27 | 28 | @Immutable 29 | data class LineAnimation( 30 | val initialValue: Float = 0f, 31 | val durationMillis: Int = 1000, 32 | val targetColor: Color, 33 | val targetValue: Float = 1f, 34 | ) 35 | -------------------------------------------------------------------------------- /libraries/timeline-view-compose/src/main/java/com/trendyol/uicomponents/timelineviewcompose/model/PointConfig.kt: -------------------------------------------------------------------------------- 1 | package com.trendyol.uicomponents.timelineviewcompose.model 2 | 3 | import androidx.compose.animation.core.InfiniteRepeatableSpec 4 | import androidx.compose.animation.core.LinearEasing 5 | import androidx.compose.animation.core.RepeatMode 6 | import androidx.compose.animation.core.infiniteRepeatable 7 | import androidx.compose.animation.core.tween 8 | import androidx.compose.runtime.Immutable 9 | import androidx.compose.ui.graphics.Color 10 | import androidx.compose.ui.unit.Dp 11 | 12 | @Immutable 13 | data class PointConfig( 14 | val outSideColor: Color, 15 | val borderWidth: Dp = TimelineViewDefaults.BorderWidth, 16 | val insideColor: Color, 17 | val size: Dp = TimelineViewDefaults.ItemSize, 18 | val animation: PointAnimation? = null, 19 | ) { 20 | 21 | fun getSizeWithBorder(): Dp { 22 | return borderWidth + size 23 | } 24 | } 25 | 26 | @Immutable 27 | data class PointAnimation( 28 | val initialValue: Float = 0.5f, 29 | val targetValue: Float = 1f, 30 | val startDelay: Int = 0, 31 | val animationSpec: InfiniteRepeatableSpec = infiniteRepeatable( 32 | repeatMode = RepeatMode.Reverse, 33 | animation = tween( 34 | durationMillis = 1000, 35 | easing = LinearEasing, 36 | ), 37 | ), 38 | ) -------------------------------------------------------------------------------- /libraries/timeline-view-compose/src/main/java/com/trendyol/uicomponents/timelineviewcompose/model/PointShadowConfig.kt: -------------------------------------------------------------------------------- 1 | package com.trendyol.uicomponents.timelineviewcompose.model 2 | 3 | import androidx.compose.runtime.Immutable 4 | import androidx.compose.ui.graphics.Color 5 | 6 | @Immutable 7 | data class PointShadowConfig( 8 | val elevation: Int, 9 | val color: Color, 10 | val alpha: Float, 11 | ) -------------------------------------------------------------------------------- /libraries/timeline-view-compose/src/main/java/com/trendyol/uicomponents/timelineviewcompose/model/TimelineItem.kt: -------------------------------------------------------------------------------- 1 | package com.trendyol.uicomponents.timelineviewcompose.model 2 | 3 | import androidx.compose.runtime.Stable 4 | import androidx.compose.ui.text.TextStyle 5 | import androidx.compose.ui.unit.Dp 6 | 7 | sealed class TimelineItem { 8 | 9 | @Stable 10 | data class Point( 11 | val text: String, 12 | val contentMargin: Dp = TimelineViewDefaults.ContentMargin, 13 | val lineConfig: LineConfig, 14 | val pointConfig: PointConfig, 15 | val textStyle: TextStyle = TimelineViewDefaults.TextStyle, 16 | val pointShadowConfig: PointShadowConfig? = null, 17 | ) : TimelineItem() 18 | 19 | @Stable 20 | data class Image( 21 | val text: String, 22 | val contentMargin: Dp = TimelineViewDefaults.ContentMargin, 23 | val imageContentDescription: String? = null, 24 | val imageConfig: ImageConfig, 25 | val lineConfig: LineConfig, 26 | val textStyle: TextStyle = TimelineViewDefaults.TextStyle, 27 | ) : TimelineItem() 28 | 29 | @Stable 30 | data class PointWithIndex( 31 | val text: String, 32 | val contentMargin: Dp = TimelineViewDefaults.ContentMargin, 33 | val lineConfig: LineConfig, 34 | val pointConfig: PointConfig, 35 | val textStyle: TextStyle = TimelineViewDefaults.TextStyle, 36 | val pointShadowConfig: PointShadowConfig? = null, 37 | val indexTextStyle: TextStyle = TimelineViewDefaults.TextStyle, 38 | ) : TimelineItem() 39 | } -------------------------------------------------------------------------------- /libraries/timeline-view-compose/src/main/java/com/trendyol/uicomponents/timelineviewcompose/model/TimelineOrientation.kt: -------------------------------------------------------------------------------- 1 | package com.trendyol.uicomponents.timelineviewcompose.model 2 | 3 | enum class TimelineOrientation { 4 | HORIZONTAL, VERTICAL 5 | } 6 | -------------------------------------------------------------------------------- /libraries/timeline-view-compose/src/main/java/com/trendyol/uicomponents/timelineviewcompose/model/TimelineViewDefaults.kt: -------------------------------------------------------------------------------- 1 | package com.trendyol.uicomponents.timelineviewcompose.model 2 | 3 | import androidx.compose.ui.text.TextStyle 4 | import androidx.compose.ui.text.font.FontFamily 5 | import androidx.compose.ui.unit.dp 6 | import androidx.compose.ui.unit.sp 7 | 8 | object TimelineViewDefaults { 9 | 10 | val ContentMargin = 4.dp 11 | 12 | val BorderWidth = 2.dp 13 | 14 | val ItemSize = 28.dp 15 | 16 | val LineSize = 48.dp 17 | 18 | val LineThickness = 2.dp 19 | 20 | val TextStyle = TextStyle(fontSize = 10.sp, fontFamily = FontFamily.Serif) 21 | } 22 | 23 | -------------------------------------------------------------------------------- /libraries/timeline-view/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | -------------------------------------------------------------------------------- /libraries/timeline-view/build.gradle.kts: -------------------------------------------------------------------------------- 1 | plugins { 2 | id(Plugins.androidLibrary) 3 | id(Plugins.kotlinAndroid) 4 | id(Plugins.mavenPublish) 5 | } 6 | 7 | kotlin.jvmToolchain(17) 8 | 9 | android { 10 | compileSdk = Configs.compileSdkVersion 11 | buildToolsVersion = Configs.buildToolsVersion 12 | 13 | defaultConfig { 14 | minSdk = Configs.minSdkVersion 15 | vectorDrawables.useSupportLibrary = true 16 | 17 | consumerProguardFiles("consumer-rules.pro") 18 | } 19 | buildTypes { 20 | getByName("release") { 21 | isMinifyEnabled = false 22 | setProguardFiles( 23 | mutableListOf( 24 | getDefaultProguardFile("proguard-android.txt"), 25 | "proguard-rules.pro" 26 | ) 27 | ) 28 | } 29 | } 30 | 31 | namespace = "com.trendyol.timelineview" 32 | buildFeatures.viewBinding = true 33 | } 34 | 35 | dependencies { 36 | implementation(Dependencies.appCompat) 37 | implementation(Dependencies.coreKtx) 38 | implementation(Dependencies.recyclerView) 39 | implementation(Dependencies.constraintLayout) 40 | } 41 | -------------------------------------------------------------------------------- /libraries/timeline-view/consumer-rules.pro: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Trendyol/android-ui-components/e98a30ce544f7c016f5a991e816736ea8833949b/libraries/timeline-view/consumer-rules.pro -------------------------------------------------------------------------------- /libraries/timeline-view/proguard-rules.pro: -------------------------------------------------------------------------------- 1 | # Add project specific ProGuard rules here. 2 | # You can control the set of applied configuration files using the 3 | # proguardFiles setting in build.gradle. 4 | # 5 | # For more details, see 6 | # http://developer.android.com/guide/developing/tools/proguard.html 7 | 8 | # If your project uses WebView with JS, uncomment the following 9 | # and specify the fully qualified class name to the JavaScript interface 10 | # class: 11 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview { 12 | # public *; 13 | #} 14 | 15 | # Uncomment this to preserve the line number information for 16 | # debugging stack traces. 17 | #-keepattributes SourceFile,LineNumberTable 18 | 19 | # If you keep the line number information, uncomment this to 20 | # hide the original source file name. 21 | #-renamesourcefileattribute SourceFile 22 | -------------------------------------------------------------------------------- /libraries/timeline-view/src/main/java/com/trendyol/timelineview/SmoothScroller.kt: -------------------------------------------------------------------------------- 1 | package com.trendyol.timelineview 2 | 3 | import android.content.Context 4 | import android.util.DisplayMetrics 5 | import androidx.recyclerview.widget.LinearSmoothScroller 6 | 7 | class SmoothScroller( 8 | context: Context, 9 | private val milliSecondsPerInch: Float = MILLISECONDS_PER_INCH 10 | ) : LinearSmoothScroller(context) { 11 | 12 | companion object { 13 | const val MILLISECONDS_PER_INCH = 240f // default is 25f (bigger = slower) 14 | } 15 | 16 | override fun calculateSpeedPerPixel(displayMetrics: DisplayMetrics): Float { 17 | return milliSecondsPerInch / displayMetrics.densityDpi 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /libraries/timeline-view/src/main/java/com/trendyol/timelineview/TimelineItem.kt: -------------------------------------------------------------------------------- 1 | package com.trendyol.timelineview 2 | 3 | data class TimelineItem( 4 | val outsideColor: String, 5 | val insideColor: String, 6 | val text: String, 7 | val textColor: String, 8 | val startLineColor: String? = null, 9 | val endLineColor: String? = null 10 | ) 11 | -------------------------------------------------------------------------------- /libraries/timeline-view/src/main/java/com/trendyol/timelineview/TimelineItemViewState.kt: -------------------------------------------------------------------------------- 1 | package com.trendyol.timelineview 2 | 3 | import android.graphics.Color 4 | import android.view.View 5 | 6 | class TimelineItemViewState( 7 | private val timelineItem: TimelineItem, 8 | val dotSize: Float, 9 | val borderWidth: Float, 10 | val textSize: Float, 11 | val lineWidth: Float, 12 | val fontFamily: String, 13 | val maxLineCount: Int 14 | ) { 15 | 16 | fun getOutsideColor(): Int = Color.parseColor(timelineItem.outsideColor) 17 | 18 | fun getInsideColor(): Int = Color.parseColor(timelineItem.insideColor) 19 | 20 | fun getText(): String = 21 | timelineItem.text.replaceFirst(" ","\n") 22 | 23 | fun getTextColor(): Int = Color.parseColor(timelineItem.textColor) 24 | 25 | fun getStartLineColor(): Int = Color.parseColor(timelineItem.startLineColor ?: hexColorWhite) 26 | 27 | fun getEndLineColor(): Int = Color.parseColor(timelineItem.endLineColor ?: hexColorWhite) 28 | 29 | fun getStartLineVisibility(): Int = 30 | if (timelineItem.startLineColor != null) View.VISIBLE else View.GONE 31 | 32 | fun getEndLineVisibility(): Int = 33 | if (timelineItem.endLineColor != null) View.VISIBLE else View.GONE 34 | 35 | fun getOutsideDotSize(): Float = dotSize 36 | 37 | fun getInsideDotSize(): Float = dotSize - (borderWidth * 2) 38 | 39 | fun getShadowDotSize(): Float = dotSize + borderWidth 40 | 41 | fun getItemWidth(): Float = 42 | dotSize + borderWidth + lineWidth 43 | 44 | fun getItemMaxLineCount(): Int = maxLineCount 45 | 46 | companion object { 47 | private const val hexColorWhite = "#000000" 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /libraries/timeline-view/src/main/java/com/trendyol/timelineview/TimelineOrientation.kt: -------------------------------------------------------------------------------- 1 | package com.trendyol.timelineview 2 | 3 | enum class TimelineOrientation { 4 | HORIZONTAL,VERTICAL 5 | } 6 | -------------------------------------------------------------------------------- /libraries/timeline-view/src/main/java/com/trendyol/timelineview/TimelineViewState.kt: -------------------------------------------------------------------------------- 1 | package com.trendyol.timelineview 2 | 3 | data class TimelineViewState( 4 | val timelineItems: List, 5 | val timelineOrientation: TimelineOrientation 6 | ) 7 | -------------------------------------------------------------------------------- /libraries/timeline-view/src/main/res/drawable/shape_oval.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 8 | -------------------------------------------------------------------------------- /libraries/timeline-view/src/main/res/layout/view_timeline.xml: -------------------------------------------------------------------------------- 1 | 2 | 8 | 9 | 17 | 18 | -------------------------------------------------------------------------------- /libraries/timeline-view/src/main/res/values/attrs.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /libraries/timeline-view/src/main/res/values/dimens.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 16dp 4 | 3dp 5 | 10sp 6 | 25dp 7 | -------------------------------------------------------------------------------- /libraries/timeline-view/src/main/res/values/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | sans-serif 4 | -------------------------------------------------------------------------------- /libraries/toolbar/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | -------------------------------------------------------------------------------- /libraries/toolbar/build.gradle.kts: -------------------------------------------------------------------------------- 1 | plugins { 2 | id(Plugins.androidLibrary) 3 | id(Plugins.kotlinAndroid) 4 | id(Plugins.mavenPublish) 5 | } 6 | 7 | kotlin.jvmToolchain(17) 8 | 9 | android { 10 | compileSdk = Configs.compileSdkVersion 11 | buildToolsVersion = Configs.buildToolsVersion 12 | 13 | defaultConfig { 14 | minSdk = Configs.minSdkVersion 15 | vectorDrawables.useSupportLibrary = true 16 | 17 | consumerProguardFiles("consumer-rules.pro") 18 | } 19 | buildFeatures.viewBinding = true 20 | buildTypes { 21 | getByName("release") { 22 | isMinifyEnabled = false 23 | setProguardFiles(mutableListOf(getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro")) 24 | } 25 | } 26 | 27 | publishing { 28 | this.singleVariant("release") { 29 | withJavadocJar() 30 | withSourcesJar() 31 | } 32 | } 33 | 34 | namespace = "com.trendyol.uicomponents.toolbar" 35 | } 36 | 37 | dependencies { 38 | implementation(Dependencies.appCompat) 39 | implementation(Dependencies.coreKtx) 40 | implementation(Dependencies.constraintLayout) 41 | } 42 | -------------------------------------------------------------------------------- /libraries/toolbar/consumer-rules.pro: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Trendyol/android-ui-components/e98a30ce544f7c016f5a991e816736ea8833949b/libraries/toolbar/consumer-rules.pro -------------------------------------------------------------------------------- /libraries/toolbar/proguard-rules.pro: -------------------------------------------------------------------------------- 1 | # Add project specific ProGuard rules here. 2 | # You can control the set of applied configuration files using the 3 | # proguardFiles setting in build.gradle. 4 | # 5 | # For more details, see 6 | # http://developer.android.com/guide/developing/tools/proguard.html 7 | 8 | # If your project uses WebView with JS, uncomment the following 9 | # and specify the fully qualified class name to the JavaScript interface 10 | # class: 11 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview { 12 | # public *; 13 | #} 14 | 15 | # Uncomment this to preserve the line number information for 16 | # debugging stack traces. 17 | #-keepattributes SourceFile,LineNumberTable 18 | 19 | # If you keep the line number information, uncomment this to 20 | # hide the original source file name. 21 | #-renamesourcefileattribute SourceFile 22 | -------------------------------------------------------------------------------- /libraries/toolbar/src/main/res/drawable/orange_dot.xml: -------------------------------------------------------------------------------- 1 | 3 | 4 | -------------------------------------------------------------------------------- /libraries/toolbar/src/main/res/drawable/trendyol_uicomponents_toolbar_arrow_back.xml: -------------------------------------------------------------------------------- 1 | 7 | 10 | 11 | -------------------------------------------------------------------------------- /libraries/toolbar/src/main/res/values/dimens.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 8dp 5 | 24dp 6 | 8dp 7 | 8 | -------------------------------------------------------------------------------- /libraries/toolbar/src/main/res/values/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 11 | 12 | 15 | 16 | 20 | 21 | -------------------------------------------------------------------------------- /libraries/touch-delegator/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | -------------------------------------------------------------------------------- /libraries/touch-delegator/build.gradle.kts: -------------------------------------------------------------------------------- 1 | plugins { 2 | id(Plugins.androidLibrary) 3 | id(Plugins.kotlinAndroid) 4 | id(Plugins.kotlinKapt) 5 | id(Plugins.mavenPublish) 6 | } 7 | 8 | kotlin.jvmToolchain(17) 9 | 10 | android { 11 | compileSdk = Configs.compileSdkVersion 12 | buildToolsVersion = Configs.buildToolsVersion 13 | 14 | defaultConfig { 15 | minSdk = Configs.minSdkVersion 16 | vectorDrawables.useSupportLibrary = true 17 | 18 | consumerProguardFiles("consumer-rules.pro") 19 | } 20 | buildTypes { 21 | getByName("release") { 22 | isMinifyEnabled = false 23 | setProguardFiles(mutableListOf(getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro")) 24 | } 25 | } 26 | 27 | namespace = "com.trendyol.uicomponents.touchdelegator" 28 | 29 | compileOptions { 30 | sourceCompatibility = JavaVersion.VERSION_17 31 | targetCompatibility = JavaVersion.VERSION_17 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /libraries/touch-delegator/consumer-rules.pro: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Trendyol/android-ui-components/e98a30ce544f7c016f5a991e816736ea8833949b/libraries/touch-delegator/consumer-rules.pro -------------------------------------------------------------------------------- /libraries/touch-delegator/proguard-rules.pro: -------------------------------------------------------------------------------- 1 | # Add project specific ProGuard rules here. 2 | # You can control the set of applied configuration files using the 3 | # proguardFiles setting in build.gradle.kts. 4 | # 5 | # For more details, see 6 | # http://developer.android.com/guide/developing/tools/proguard.html 7 | 8 | # If your project uses WebView with JS, uncomment the following 9 | # and specify the fully qualified class name to the JavaScript interface 10 | # class: 11 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview { 12 | # public *; 13 | #} 14 | 15 | # Uncomment this to preserve the line number information for 16 | # debugging stack traces. 17 | #-keepattributes SourceFile,LineNumberTable 18 | 19 | # If you keep the line number information, uncomment this to 20 | # hide the original source file name. 21 | #-renamesourcefileattribute SourceFile 22 | -------------------------------------------------------------------------------- /libraries/touch-delegator/src/main/java/com/trendyol/uicomponents/touchdelegator/ActivityTouchDelegator.kt: -------------------------------------------------------------------------------- 1 | package com.trendyol.uicomponents.touchdelegator 2 | 3 | import android.view.MotionEvent 4 | import android.view.Window 5 | 6 | class ActivityWindowTouchDelegator : WindowTouchListener { 7 | 8 | private val touchListeners = mutableSetOf() 9 | 10 | fun addListener(windowTouchListener: WindowTouchListener) { 11 | touchListeners.add(windowTouchListener) 12 | } 13 | 14 | override fun onTouchEvent(window: Window, event: MotionEvent): Boolean { 15 | for (touchListener in touchListeners) { 16 | if (touchListener.onTouchEvent(window, event)) { 17 | return true 18 | } 19 | } 20 | return false 21 | } 22 | 23 | fun getWindowTouchListeners() = touchListeners 24 | } 25 | -------------------------------------------------------------------------------- /libraries/touch-delegator/src/main/java/com/trendyol/uicomponents/touchdelegator/WindowTouchDelegator.kt: -------------------------------------------------------------------------------- 1 | package com.trendyol.uicomponents.touchdelegator 2 | 3 | import android.view.MotionEvent 4 | import android.view.Window 5 | 6 | interface WindowTouchDelegator : WindowTouchListener { 7 | 8 | fun getWindowTouchListeners(): MutableSet 9 | 10 | fun addListener(windowTouchListener: WindowTouchListener) 11 | 12 | override fun onTouchEvent(window: Window, event: MotionEvent): Boolean { 13 | for (touchListener in getWindowTouchListeners()) { 14 | if (touchListener.onTouchEvent(window, event)) { 15 | return true 16 | } 17 | } 18 | return false 19 | } 20 | } -------------------------------------------------------------------------------- /libraries/touch-delegator/src/main/java/com/trendyol/uicomponents/touchdelegator/WindowTouchListener.kt: -------------------------------------------------------------------------------- 1 | package com.trendyol.uicomponents.touchdelegator 2 | 3 | import android.view.MotionEvent 4 | import android.view.Window 5 | 6 | interface WindowTouchListener { 7 | 8 | fun onTouchEvent(window: Window, event: MotionEvent): Boolean 9 | } 10 | -------------------------------------------------------------------------------- /sample-compose/.gitignore: -------------------------------------------------------------------------------- 1 | /build -------------------------------------------------------------------------------- /sample-compose/build.gradle.kts: -------------------------------------------------------------------------------- 1 | plugins { 2 | id(Plugins.androidApplication) 3 | id(Plugins.kotlinAndroid) 4 | id(Plugins.compose) version "2.0.0" 5 | } 6 | 7 | kotlin.jvmToolchain(17) 8 | 9 | android { 10 | compileSdk = Configs.compileSdkVersion 11 | buildToolsVersion = Configs.buildToolsVersion 12 | namespace = "com.trendyol.uicomponents.sample.compose" 13 | 14 | defaultConfig { 15 | applicationId = Configs.applicationId 16 | minSdk = Configs.minSdkVersion 17 | targetSdk = Configs.targetSdkVersion 18 | versionCode = 1 19 | versionName = "1.0" 20 | } 21 | buildTypes { 22 | getByName("release") { 23 | isMinifyEnabled = false 24 | setProguardFiles( 25 | mutableListOf( 26 | getDefaultProguardFile("proguard-android.txt"), 27 | "proguard-rules.pro" 28 | ) 29 | ) 30 | } 31 | } 32 | buildFeatures { 33 | compose = true 34 | } 35 | 36 | composeOptions { 37 | kotlinCompilerExtensionVersion = Dependencies.kotlinCompilerExtensionVersion 38 | } 39 | } 40 | 41 | dependencies { 42 | implementation(platform(Dependencies.composeBom)) 43 | implementation(Dependencies.composeCoil) 44 | implementation(Dependencies.composeConstraintLayout) 45 | implementation(Dependencies.composeMaterial) 46 | implementation(Dependencies.composeRuntime) 47 | implementation(Dependencies.composeUiTooling) 48 | implementation(Dependencies.composeActivity) 49 | implementation(Dependencies.composeNavigation) 50 | 51 | implementation(projects.libraries.timelineViewCompose) 52 | implementation(projects.libraries.ratingBarCompose) 53 | implementation(projects.libraries.quantityPickerCompose) 54 | } 55 | -------------------------------------------------------------------------------- /sample-compose/proguard-rules.pro: -------------------------------------------------------------------------------- 1 | # Add project specific ProGuard rules here. 2 | # You can control the set of applied configuration files using the 3 | # proguardFiles setting in build.gradle. 4 | # 5 | # For more details, see 6 | # http://developer.android.com/guide/developing/tools/proguard.html 7 | 8 | # If your project uses WebView with JS, uncomment the following 9 | # and specify the fully qualified class name to the JavaScript interface 10 | # class: 11 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview { 12 | # public *; 13 | #} 14 | 15 | # Uncomment this to preserve the line number information for 16 | # debugging stack traces. 17 | #-keepattributes SourceFile,LineNumberTable 18 | 19 | # If you keep the line number information, uncomment this to 20 | # hide the original source file name. 21 | #-renamesourcefileattribute SourceFile -------------------------------------------------------------------------------- /sample-compose/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 7 | 8 | 15 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /sample-compose/src/main/java/com/trendyol/uicomponents/samplecompose/ComponentsScreen.kt: -------------------------------------------------------------------------------- 1 | package com.trendyol.uicomponents.samplecompose 2 | 3 | import androidx.compose.foundation.layout.Column 4 | import androidx.compose.foundation.layout.Spacer 5 | import androidx.compose.foundation.layout.fillMaxSize 6 | import androidx.compose.foundation.layout.fillMaxWidth 7 | import androidx.compose.foundation.layout.height 8 | import androidx.compose.foundation.layout.padding 9 | import androidx.compose.material.Button 10 | import androidx.compose.material.MaterialTheme 11 | import androidx.compose.material.Text 12 | import androidx.compose.runtime.Composable 13 | import androidx.compose.ui.Alignment 14 | import androidx.compose.ui.Modifier 15 | import androidx.compose.ui.unit.dp 16 | 17 | @Composable 18 | fun ComponentsScreen( 19 | onItemClick: (Route) -> Unit, 20 | ) { 21 | Column( 22 | horizontalAlignment = Alignment.CenterHorizontally, 23 | modifier = Modifier 24 | .fillMaxSize() 25 | .padding(16.dp), 26 | ) { 27 | Text("Select Component", style = MaterialTheme.typography.h6) 28 | 29 | Spacer(modifier = Modifier.height(16.dp)) 30 | 31 | ComponentItem(title = "TimelineView") { 32 | onItemClick(Route.TimelineView) 33 | } 34 | 35 | ComponentItem(title = "RatingBar") { 36 | onItemClick(Route.RatingBar) 37 | } 38 | 39 | ComponentItem(title = "Quantity Picker") { 40 | onItemClick(Route.QuantityPicker) 41 | } 42 | } 43 | } 44 | 45 | 46 | @Composable 47 | private fun ComponentItem(title: String, onClick: () -> Unit) { 48 | Button( 49 | modifier = Modifier.fillMaxWidth(), 50 | onClick = onClick, 51 | ) { 52 | Text(text = title) 53 | } 54 | } -------------------------------------------------------------------------------- /sample-compose/src/main/java/com/trendyol/uicomponents/samplecompose/MainActivity.kt: -------------------------------------------------------------------------------- 1 | package com.trendyol.uicomponents.samplecompose 2 | 3 | import android.os.Bundle 4 | import androidx.activity.ComponentActivity 5 | import androidx.activity.compose.setContent 6 | import androidx.compose.foundation.layout.fillMaxSize 7 | import androidx.compose.foundation.layout.padding 8 | import androidx.compose.material.Scaffold 9 | import androidx.compose.ui.Modifier 10 | import com.trendyol.uicomponents.samplecompose.ui.theme.UIComponentsTheme 11 | 12 | class MainActivity : ComponentActivity() { 13 | override fun onCreate(savedInstanceState: Bundle?) { 14 | super.onCreate(savedInstanceState) 15 | setContent { 16 | UIComponentsTheme { 17 | Scaffold( 18 | modifier = Modifier.fillMaxSize() 19 | ) { paddingValues -> 20 | SampleComposeNavGraph(modifier = Modifier.padding(paddingValues)) 21 | } 22 | } 23 | } 24 | } 25 | } -------------------------------------------------------------------------------- /sample-compose/src/main/java/com/trendyol/uicomponents/samplecompose/RatingBarScreen.kt: -------------------------------------------------------------------------------- 1 | package com.trendyol.uicomponents.samplecompose 2 | 3 | import androidx.compose.foundation.layout.Column 4 | import androidx.compose.foundation.layout.fillMaxSize 5 | import androidx.compose.runtime.Composable 6 | import androidx.compose.ui.Modifier 7 | import androidx.compose.ui.graphics.Color 8 | import androidx.compose.ui.unit.dp 9 | import com.trendyol.uicomponents.ratingbarcompose.RatingBar 10 | 11 | @Composable 12 | fun RatingBarScreen( 13 | modifier: Modifier = Modifier, 14 | ) { 15 | 16 | Column(modifier = modifier.fillMaxSize()) { 17 | RatingBar( 18 | rating = 3.7f, 19 | filledColor = Color.Green, 20 | spaceBetween = 6.dp, 21 | itemCount = 8, 22 | itemSize = 42.dp, 23 | ) 24 | } 25 | } -------------------------------------------------------------------------------- /sample-compose/src/main/java/com/trendyol/uicomponents/samplecompose/Route.kt: -------------------------------------------------------------------------------- 1 | package com.trendyol.uicomponents.samplecompose 2 | 3 | sealed class Route(val destination: String) { 4 | 5 | data object Components : Route("components") 6 | 7 | data object TimelineView : Route("timelineView") 8 | 9 | data object RatingBar : Route("ratingbar") 10 | 11 | data object QuantityPicker : Route("quantityPicker") 12 | } 13 | -------------------------------------------------------------------------------- /sample-compose/src/main/java/com/trendyol/uicomponents/samplecompose/SampleComposeNavGraph.kt: -------------------------------------------------------------------------------- 1 | package com.trendyol.uicomponents.samplecompose 2 | 3 | import androidx.compose.foundation.layout.statusBarsPadding 4 | import androidx.compose.runtime.Composable 5 | import androidx.compose.ui.Modifier 6 | import androidx.navigation.NavHostController 7 | import androidx.navigation.compose.NavHost 8 | import androidx.navigation.compose.composable 9 | import androidx.navigation.compose.rememberNavController 10 | 11 | @Composable 12 | fun SampleComposeNavGraph( 13 | modifier: Modifier = Modifier, 14 | navController: NavHostController = rememberNavController(), 15 | ) { 16 | 17 | NavHost( 18 | modifier = modifier.statusBarsPadding(), 19 | navController = navController, 20 | startDestination = Route.Components.destination 21 | ) { 22 | composable(Route.Components.destination) { 23 | ComponentsScreen { 24 | navController.navigate(it.destination) 25 | } 26 | } 27 | 28 | composable(Route.TimelineView.destination) { 29 | TimelineViewScreen() 30 | } 31 | 32 | composable(Route.RatingBar.destination) { 33 | RatingBarScreen() 34 | } 35 | 36 | composable(Route.QuantityPicker.destination) { 37 | QuantityPickerScreen() 38 | } 39 | } 40 | } -------------------------------------------------------------------------------- /sample-compose/src/main/java/com/trendyol/uicomponents/samplecompose/ui/productcard/ProductCardData.kt: -------------------------------------------------------------------------------- 1 | package com.trendyol.uicomponents.samplecompose.ui.productcard 2 | 3 | import com.trendyol.uicomponents.quantitypicker.QuantityPickerViewData 4 | 5 | data class ProductCardData( 6 | val id: String = "", 7 | val title: String, 8 | val quantityData: QuantityPickerViewData = QuantityPickerViewData(), 9 | val isLoading: Boolean = false, 10 | ) 11 | -------------------------------------------------------------------------------- /sample-compose/src/main/java/com/trendyol/uicomponents/samplecompose/ui/theme/Color.kt: -------------------------------------------------------------------------------- 1 | package com.trendyol.uicomponents.samplecompose.ui.theme 2 | 3 | import androidx.compose.ui.graphics.Color 4 | 5 | val ColorPrimary = Color(0xFFF27A1A) 6 | val ColorPrimaryDark = Color(0xFFB94B00) 7 | val ColorAccent = Color(0xFFF27A1A) 8 | val ColorBackground = Color(0xFFF5F5F5) -------------------------------------------------------------------------------- /sample-compose/src/main/java/com/trendyol/uicomponents/samplecompose/ui/theme/Shape.kt: -------------------------------------------------------------------------------- 1 | package com.trendyol.uicomponents.samplecompose.ui.theme 2 | 3 | import androidx.compose.foundation.shape.RoundedCornerShape 4 | import androidx.compose.material.Shapes 5 | import androidx.compose.ui.unit.dp 6 | 7 | val Shapes = Shapes( 8 | small = RoundedCornerShape(4.dp), 9 | medium = RoundedCornerShape(4.dp), 10 | large = RoundedCornerShape(0.dp) 11 | ) -------------------------------------------------------------------------------- /sample-compose/src/main/java/com/trendyol/uicomponents/samplecompose/ui/theme/Theme.kt: -------------------------------------------------------------------------------- 1 | package com.trendyol.uicomponents.samplecompose.ui.theme 2 | 3 | import androidx.compose.foundation.isSystemInDarkTheme 4 | import androidx.compose.material.MaterialTheme 5 | import androidx.compose.material.darkColors 6 | import androidx.compose.material.lightColors 7 | import androidx.compose.runtime.Composable 8 | 9 | private val DarkColorPalette = darkColors( 10 | primary = ColorPrimary, 11 | primaryVariant = ColorPrimaryDark, 12 | secondary = ColorAccent 13 | ) 14 | 15 | private val LightColorPalette = lightColors( 16 | primary = ColorPrimary, 17 | primaryVariant = ColorPrimaryDark, 18 | secondary = ColorAccent 19 | 20 | /* Other default colors to override 21 | background = Color.White, 22 | surface = Color.White, 23 | onPrimary = Color.White, 24 | onSecondary = Color.Black, 25 | onBackground = Color.Black, 26 | onSurface = Color.Black, 27 | */ 28 | ) 29 | 30 | @Composable 31 | fun UIComponentsTheme(darkTheme: Boolean = isSystemInDarkTheme(), content: @Composable () -> Unit) { 32 | val colors = if (darkTheme) { 33 | DarkColorPalette 34 | } else { 35 | LightColorPalette 36 | } 37 | 38 | MaterialTheme( 39 | colors = colors, 40 | typography = Typography, 41 | shapes = Shapes, 42 | content = content 43 | ) 44 | } -------------------------------------------------------------------------------- /sample-compose/src/main/java/com/trendyol/uicomponents/samplecompose/ui/theme/Type.kt: -------------------------------------------------------------------------------- 1 | package com.trendyol.uicomponents.samplecompose.ui.theme 2 | 3 | import androidx.compose.material.Typography 4 | import androidx.compose.ui.text.TextStyle 5 | import androidx.compose.ui.text.font.FontFamily 6 | import androidx.compose.ui.text.font.FontWeight 7 | import androidx.compose.ui.unit.sp 8 | 9 | // Set of Material typography styles to start with 10 | val Typography = Typography( 11 | body1 = TextStyle( 12 | fontFamily = FontFamily.Default, 13 | fontWeight = FontWeight.Normal, 14 | fontSize = 16.sp 15 | ), 16 | body2 = TextStyle( 17 | fontFamily = FontFamily.Monospace, 18 | fontWeight = FontWeight.Bold, 19 | fontSize = 12.sp, 20 | ) 21 | 22 | /* Other default text styles to override 23 | button = TextStyle( 24 | fontFamily = FontFamily.Default, 25 | fontWeight = FontWeight.W500, 26 | fontSize = 14.sp 27 | ), 28 | caption = TextStyle( 29 | fontFamily = FontFamily.Default, 30 | fontWeight = FontWeight.Normal, 31 | fontSize = 12.sp 32 | ) 33 | */ 34 | ) -------------------------------------------------------------------------------- /sample-compose/src/main/res/drawable-v24/ic_launcher_foreground.xml: -------------------------------------------------------------------------------- 1 | 7 | 8 | 9 | 15 | 18 | 21 | 22 | 23 | 24 | 30 | -------------------------------------------------------------------------------- /sample-compose/src/main/res/mipmap-anydpi-v26/ic_launcher.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /sample-compose/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /sample-compose/src/main/res/mipmap-anydpi-v33/ic_launcher.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /sample-compose/src/main/res/mipmap-hdpi/ic_launcher.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Trendyol/android-ui-components/e98a30ce544f7c016f5a991e816736ea8833949b/sample-compose/src/main/res/mipmap-hdpi/ic_launcher.webp -------------------------------------------------------------------------------- /sample-compose/src/main/res/mipmap-hdpi/ic_launcher_round.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Trendyol/android-ui-components/e98a30ce544f7c016f5a991e816736ea8833949b/sample-compose/src/main/res/mipmap-hdpi/ic_launcher_round.webp -------------------------------------------------------------------------------- /sample-compose/src/main/res/mipmap-mdpi/ic_launcher.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Trendyol/android-ui-components/e98a30ce544f7c016f5a991e816736ea8833949b/sample-compose/src/main/res/mipmap-mdpi/ic_launcher.webp -------------------------------------------------------------------------------- /sample-compose/src/main/res/mipmap-mdpi/ic_launcher_round.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Trendyol/android-ui-components/e98a30ce544f7c016f5a991e816736ea8833949b/sample-compose/src/main/res/mipmap-mdpi/ic_launcher_round.webp -------------------------------------------------------------------------------- /sample-compose/src/main/res/mipmap-xhdpi/ic_launcher.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Trendyol/android-ui-components/e98a30ce544f7c016f5a991e816736ea8833949b/sample-compose/src/main/res/mipmap-xhdpi/ic_launcher.webp -------------------------------------------------------------------------------- /sample-compose/src/main/res/mipmap-xhdpi/ic_launcher_round.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Trendyol/android-ui-components/e98a30ce544f7c016f5a991e816736ea8833949b/sample-compose/src/main/res/mipmap-xhdpi/ic_launcher_round.webp -------------------------------------------------------------------------------- /sample-compose/src/main/res/mipmap-xxhdpi/ic_launcher.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Trendyol/android-ui-components/e98a30ce544f7c016f5a991e816736ea8833949b/sample-compose/src/main/res/mipmap-xxhdpi/ic_launcher.webp -------------------------------------------------------------------------------- /sample-compose/src/main/res/mipmap-xxhdpi/ic_launcher_round.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Trendyol/android-ui-components/e98a30ce544f7c016f5a991e816736ea8833949b/sample-compose/src/main/res/mipmap-xxhdpi/ic_launcher_round.webp -------------------------------------------------------------------------------- /sample-compose/src/main/res/mipmap-xxxhdpi/ic_launcher.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Trendyol/android-ui-components/e98a30ce544f7c016f5a991e816736ea8833949b/sample-compose/src/main/res/mipmap-xxxhdpi/ic_launcher.webp -------------------------------------------------------------------------------- /sample-compose/src/main/res/mipmap-xxxhdpi/ic_launcher_round.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Trendyol/android-ui-components/e98a30ce544f7c016f5a991e816736ea8833949b/sample-compose/src/main/res/mipmap-xxxhdpi/ic_launcher_round.webp -------------------------------------------------------------------------------- /sample-compose/src/main/res/values/colors.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | #F27A1A 4 | #B94B00 5 | #F27A1A 6 | #666666 7 | 8 | -------------------------------------------------------------------------------- /sample-compose/src/main/res/values/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | sample-compose 3 | -------------------------------------------------------------------------------- /sample-compose/src/main/res/values/themes.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 7 | -------------------------------------------------------------------------------- /sample/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | -------------------------------------------------------------------------------- /sample/build.gradle.kts: -------------------------------------------------------------------------------- 1 | plugins { 2 | id(Plugins.androidApplication) 3 | id(Plugins.kotlinAndroid) 4 | } 5 | 6 | kotlin.jvmToolchain(17) 7 | 8 | android { 9 | compileSdk = Configs.compileSdkVersion 10 | buildToolsVersion = Configs.buildToolsVersion 11 | 12 | namespace = "com.trendyol.uicomponents" 13 | 14 | defaultConfig { 15 | applicationId = Configs.applicationId 16 | minSdk = Configs.minSdkVersion 17 | targetSdk = Configs.targetSdkVersion 18 | versionCode = 1 19 | versionName = "1.0" 20 | } 21 | buildTypes { 22 | release { 23 | isMinifyEnabled = false 24 | setProguardFiles( 25 | mutableListOf( 26 | getDefaultProguardFile("proguard-android.txt"), 27 | "proguard-rules.pro" 28 | ) 29 | ) 30 | } 31 | all { 32 | isPseudoLocalesEnabled = true 33 | } 34 | } 35 | 36 | buildFeatures.viewBinding = true 37 | } 38 | 39 | dependencies { 40 | implementation(projects.libraries.ratingBar) 41 | implementation(projects.libraries.dialogs) 42 | implementation(projects.libraries.imageSlider) 43 | implementation(projects.libraries.phonenumber) 44 | implementation(projects.libraries.toolbar) 45 | implementation(projects.libraries.suggestionInputView) 46 | implementation(projects.libraries.cardInputView) 47 | implementation(projects.libraries.quantityPickerView) 48 | implementation(projects.libraries.timelineView) 49 | implementation(projects.libraries.fitOptionMessageView) 50 | 51 | implementation(Dependencies.appCompat) 52 | implementation(Dependencies.coreKtx) 53 | implementation(Dependencies.material) 54 | implementation(Dependencies.constraintLayout) 55 | implementation(Dependencies.glide) 56 | } 57 | -------------------------------------------------------------------------------- /sample/proguard-rules.pro: -------------------------------------------------------------------------------- 1 | # Add project specific ProGuard rules here. 2 | # You can control the set of applied configuration files using the 3 | # proguardFiles setting in build.gradle. 4 | # 5 | # For more details, see 6 | # http://developer.android.com/guide/developing/tools/proguard.html 7 | 8 | # If your project uses WebView with JS, uncomment the following 9 | # and specify the fully qualified class name to the JavaScript interface 10 | # class: 11 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview { 12 | # public *; 13 | #} 14 | 15 | # Uncomment this to preserve the line number information for 16 | # debugging stack traces. 17 | #-keepattributes SourceFile,LineNumberTable 18 | 19 | # If you keep the line number information, uncomment this to 20 | # hide the original source file name. 21 | #-renamesourcefileattribute SourceFile 22 | -------------------------------------------------------------------------------- /sample/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 7 | 8 | 16 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | -------------------------------------------------------------------------------- /sample/src/main/java/com/trendyol/uicomponents/Extensions.kt: -------------------------------------------------------------------------------- 1 | package com.trendyol.uicomponents 2 | 3 | import android.content.Context 4 | import android.graphics.drawable.Drawable 5 | import android.util.TypedValue 6 | import androidx.annotation.AttrRes 7 | import androidx.annotation.DrawableRes 8 | import androidx.annotation.FontRes 9 | import androidx.appcompat.content.res.AppCompatResources 10 | 11 | // from https://stackoverflow.com/a/55573791 12 | fun Context.themeColor(@AttrRes attrRes: Int): Int { 13 | val typedValue = TypedValue() 14 | theme.resolveAttribute(attrRes, typedValue, true) 15 | return typedValue.data 16 | } 17 | 18 | fun Context.drawable(@DrawableRes resId: Int): Drawable = 19 | AppCompatResources.getDrawable(this, resId) ?: throw NullPointerException("nooooo") 20 | 21 | fun Context.asSP(value: Int): Int = 22 | (value * resources.displayMetrics.scaledDensity).toInt() 23 | 24 | fun Context.asDP(value: Int): Int = 25 | (value * resources.displayMetrics.density).toInt() 26 | 27 | @FontRes 28 | fun Context.themeFont(@AttrRes attribute: Int): Int { 29 | val typedValue = TypedValue() 30 | if (theme.resolveAttribute(attribute, typedValue, true)) { 31 | return typedValue.resourceId 32 | } else { 33 | throw IllegalArgumentException("[android.util.TypedValue] has returned 0 for given resId=$attribute") 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /sample/src/main/java/com/trendyol/uicomponents/FitOptionMessageViewActivity.kt: -------------------------------------------------------------------------------- 1 | package com.trendyol.uicomponents 2 | 3 | import android.os.Bundle 4 | import androidx.appcompat.app.AppCompatActivity 5 | import com.trendyol.uicomponents.databinding.ActivityFitOptionMessageBinding 6 | 7 | class FitOptionMessageViewActivity : AppCompatActivity() { 8 | 9 | private lateinit var binding: ActivityFitOptionMessageBinding 10 | 11 | override fun onCreate(savedInstanceState: Bundle?) { 12 | super.onCreate(savedInstanceState) 13 | binding = ActivityFitOptionMessageBinding.inflate(layoutInflater) 14 | setContentView(binding.root) 15 | 16 | // setting a custom animation 17 | /*binding.fitOptionMessage.revealAnimationProvider = { imageView, textView -> 18 | imageView.alpha = 0f 19 | textView.alpha = 0f 20 | textView.animate().alpha(1f).setDuration(1000).start() 21 | imageView.animate().alpha(1f).setDuration(1000).start() 22 | } 23 | */ 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /sample/src/main/java/com/trendyol/uicomponents/ImageSliderActivity.kt: -------------------------------------------------------------------------------- 1 | package com.trendyol.uicomponents 2 | 3 | import android.os.Bundle 4 | import android.widget.ImageView 5 | import androidx.appcompat.app.AppCompatActivity 6 | import com.trendyol.uicomponents.databinding.ActivityImageSliderBinding 7 | import com.trendyol.uicomponents.imageslider.ImageSliderViewState 8 | 9 | class ImageSliderActivity : AppCompatActivity() { 10 | 11 | 12 | private lateinit var binding: ActivityImageSliderBinding 13 | 14 | override fun onCreate(savedInstanceState: Bundle?) { 15 | super.onCreate(savedInstanceState) 16 | binding = ActivityImageSliderBinding.inflate(layoutInflater) 17 | setContentView(binding.root) 18 | binding.imageSliderView.setActivityInstance(this) 19 | binding.imageSliderView.setViewState( 20 | ImageSliderViewState( 21 | listOf( 22 | "https://picsum.photos/id/1026/1920/1280", 23 | "https://picsum.photos/id/1024/1920/1280", 24 | "https://picsum.photos/id/1027/1920/1280", 25 | "https://picsum.photos/id/1028/1920/1280", 26 | "https://picsum.photos/id/1029/1920/1280" 27 | ), 28 | cornerRadiusInDp = 8.0, 29 | scaleType = ImageView.ScaleType.FIT_CENTER 30 | ) 31 | ) 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /sample/src/main/java/com/trendyol/uicomponents/PhoneNumberActivity.kt: -------------------------------------------------------------------------------- 1 | package com.trendyol.uicomponents 2 | 3 | import android.os.Bundle 4 | import androidx.appcompat.app.AppCompatActivity 5 | import com.trendyol.uicomponents.databinding.ActivityPhoneNumberBinding 6 | import com.trendyol.uicomponents.phonenumber.PhoneNumberTextInputEditTextViewState 7 | 8 | class PhoneNumberActivity : AppCompatActivity() { 9 | 10 | private lateinit var binding: ActivityPhoneNumberBinding 11 | 12 | override fun onCreate(savedInstanceState: Bundle?) { 13 | super.onCreate(savedInstanceState) 14 | binding = ActivityPhoneNumberBinding.inflate(layoutInflater) 15 | setContentView(binding.root) 16 | 17 | with(binding.editTextPhoneDot) { 18 | setMaskCharacter('●') 19 | setMaskable(true) 20 | setText("0555●●●●●55") 21 | } 22 | with(binding.editTextPhoneStar) { 23 | viewState = PhoneNumberTextInputEditTextViewState(maskable = true, maskCharacter = '*') 24 | setText("0555*****55") 25 | } 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /sample/src/main/java/com/trendyol/uicomponents/RatingBarActivity.kt: -------------------------------------------------------------------------------- 1 | package com.trendyol.uicomponents 2 | 3 | import android.os.Bundle 4 | import androidx.appcompat.app.AppCompatActivity 5 | 6 | class RatingBarActivity : AppCompatActivity() { 7 | 8 | override fun onCreate(savedInstanceState: Bundle?) { 9 | super.onCreate(savedInstanceState) 10 | setContentView(R.layout.activity_rating_bar) 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /sample/src/main/java/com/trendyol/uicomponents/WebViewDomAndJSEnabler.kt: -------------------------------------------------------------------------------- 1 | package com.trendyol.uicomponents 2 | 3 | import android.webkit.WebView 4 | import android.webkit.WebViewClient 5 | import androidx.fragment.app.Fragment 6 | import com.trendyol.uicomponents.dialogs.DialogFragment 7 | import com.trendyol.uicomponents.dialogs.configurator.WebViewConfigurator 8 | 9 | class WebViewDomAndJSEnabler : WebViewConfigurator, Fragment() { 10 | 11 | override fun configureWebView( 12 | dialogFragment: DialogFragment, 13 | webView: WebView 14 | ) { 15 | webView.settings.javaScriptEnabled = true 16 | webView.settings.domStorageEnabled = true 17 | webView.webViewClient = WebViewClient() 18 | } 19 | } -------------------------------------------------------------------------------- /sample/src/main/java/com/trendyol/uicomponents/WebViewDownloadListenerConfigurator.kt: -------------------------------------------------------------------------------- 1 | package com.trendyol.uicomponents 2 | 3 | import android.app.DownloadManager 4 | import android.net.Uri 5 | import android.os.Environment 6 | import android.webkit.DownloadListener 7 | import android.webkit.URLUtil 8 | import android.webkit.WebView 9 | import androidx.core.content.ContextCompat 10 | import androidx.core.os.bundleOf 11 | import androidx.fragment.app.Fragment 12 | import com.trendyol.uicomponents.dialogs.DialogFragment 13 | import com.trendyol.uicomponents.dialogs.configurator.WebViewDownloadConfigurator 14 | 15 | class WebViewDownloadListenerConfigurator : WebViewDownloadConfigurator, Fragment() { 16 | private val downloadManager: DownloadManager? by lazy(LazyThreadSafetyMode.NONE) { 17 | ContextCompat.getSystemService(requireContext(), DownloadManager::class.java) 18 | } 19 | 20 | override fun configureDownloadListener(fragment: DialogFragment, webView: WebView) { 21 | webView.setDownloadListener(DownloadListener { url, _, contentDisposition, mimetype, _ -> 22 | val downloadRequest = DownloadManager.Request(Uri.parse(url)) 23 | .setTitle(requireArguments().getString("title")) 24 | .setMimeType(mimetype) 25 | .setDestinationInExternalPublicDir( 26 | Environment.DIRECTORY_DOWNLOADS, 27 | URLUtil.guessFileName(url, contentDisposition, mimetype) 28 | ) 29 | .setNotificationVisibility(DownloadManager.Request.VISIBILITY_VISIBLE_NOTIFY_COMPLETED) 30 | downloadManager?.enqueue(downloadRequest) 31 | }) 32 | } 33 | 34 | companion object { 35 | fun newInstance(title: String): WebViewDownloadListenerConfigurator = 36 | WebViewDownloadListenerConfigurator().apply { 37 | this.arguments = bundleOf("title" to title) 38 | } 39 | } 40 | 41 | } -------------------------------------------------------------------------------- /sample/src/main/java/com/trendyol/uicomponents/WebViewJavascriptEnabler.kt: -------------------------------------------------------------------------------- 1 | package com.trendyol.uicomponents 2 | 3 | import android.webkit.WebView 4 | import androidx.fragment.app.Fragment 5 | import com.trendyol.uicomponents.dialogs.DialogFragment 6 | import com.trendyol.uicomponents.dialogs.configurator.WebViewConfigurator 7 | 8 | class WebViewJavascriptEnabler : WebViewConfigurator, Fragment() { 9 | 10 | override fun configureWebView(dialogFragment: DialogFragment, webView: WebView) { 11 | webView.settings.javaScriptEnabled = true 12 | } 13 | } -------------------------------------------------------------------------------- /sample/src/main/res/drawable-v24/ic_launcher_foreground.xml: -------------------------------------------------------------------------------- 1 | 7 | 12 | 13 | 19 | 22 | 25 | 26 | 27 | 28 | 34 | 35 | -------------------------------------------------------------------------------- /sample/src/main/res/drawable/ic_check.xml: -------------------------------------------------------------------------------- 1 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /sample/src/main/res/drawable/ic_info.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 13 | 14 | -------------------------------------------------------------------------------- /sample/src/main/res/drawable/ic_info_black_24.xml: -------------------------------------------------------------------------------- 1 | 7 | 8 | 11 | 12 | -------------------------------------------------------------------------------- /sample/src/main/res/drawable/ic_mc_logo.xml: -------------------------------------------------------------------------------- 1 | 6 | 11 | 14 | 17 | 20 | 23 | 24 | -------------------------------------------------------------------------------- /sample/src/main/res/drawable/ic_visa_logo.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 12 | 15 | 18 | 21 | 22 | -------------------------------------------------------------------------------- /sample/src/main/res/drawable/rounded_corner.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /sample/src/main/res/drawable/sample_banana.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Trendyol/android-ui-components/e98a30ce544f7c016f5a991e816736ea8833949b/sample/src/main/res/drawable/sample_banana.png -------------------------------------------------------------------------------- /sample/src/main/res/drawable/sample_euro.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Trendyol/android-ui-components/e98a30ce544f7c016f5a991e816736ea8833949b/sample/src/main/res/drawable/sample_euro.png -------------------------------------------------------------------------------- /sample/src/main/res/drawable/shape_info_list_dialog_divider.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /sample/src/main/res/drawable/shape_selected_background_suggestion_item.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /sample/src/main/res/drawable/shape_unselected_background_suggestion_item.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /sample/src/main/res/layout/activity_image_slider.xml: -------------------------------------------------------------------------------- 1 | 2 | 8 | 9 | 13 | 14 | -------------------------------------------------------------------------------- /sample/src/main/res/layout/activity_phone_number.xml: -------------------------------------------------------------------------------- 1 | 2 | 8 | 9 | 12 | 13 | 18 | 19 | 20 | 23 | 24 | 29 | 30 | 31 | -------------------------------------------------------------------------------- /sample/src/main/res/layout/activity_timeline_view.xml: -------------------------------------------------------------------------------- 1 | 2 | 9 | 10 | 20 | 21 | 32 | 33 | -------------------------------------------------------------------------------- /sample/src/main/res/mipmap-anydpi-v26/ic_launcher.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /sample/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /sample/src/main/res/mipmap-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Trendyol/android-ui-components/e98a30ce544f7c016f5a991e816736ea8833949b/sample/src/main/res/mipmap-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /sample/src/main/res/mipmap-hdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Trendyol/android-ui-components/e98a30ce544f7c016f5a991e816736ea8833949b/sample/src/main/res/mipmap-hdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /sample/src/main/res/mipmap-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Trendyol/android-ui-components/e98a30ce544f7c016f5a991e816736ea8833949b/sample/src/main/res/mipmap-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /sample/src/main/res/mipmap-mdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Trendyol/android-ui-components/e98a30ce544f7c016f5a991e816736ea8833949b/sample/src/main/res/mipmap-mdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /sample/src/main/res/mipmap-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Trendyol/android-ui-components/e98a30ce544f7c016f5a991e816736ea8833949b/sample/src/main/res/mipmap-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /sample/src/main/res/mipmap-xhdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Trendyol/android-ui-components/e98a30ce544f7c016f5a991e816736ea8833949b/sample/src/main/res/mipmap-xhdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /sample/src/main/res/mipmap-xxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Trendyol/android-ui-components/e98a30ce544f7c016f5a991e816736ea8833949b/sample/src/main/res/mipmap-xxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /sample/src/main/res/mipmap-xxhdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Trendyol/android-ui-components/e98a30ce544f7c016f5a991e816736ea8833949b/sample/src/main/res/mipmap-xxhdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /sample/src/main/res/mipmap-xxxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Trendyol/android-ui-components/e98a30ce544f7c016f5a991e816736ea8833949b/sample/src/main/res/mipmap-xxxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /sample/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Trendyol/android-ui-components/e98a30ce544f7c016f5a991e816736ea8833949b/sample/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /sample/src/main/res/values-ar/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | يوصي معظم المستخدمين بشراء المنتج بحجمك الخاص. 3 | 4 | -------------------------------------------------------------------------------- /sample/src/main/res/values/colors.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | #F27A1A 4 | #B94B00 5 | #F27A1A 6 | #666666 7 | 8 | -------------------------------------------------------------------------------- /sample/src/main/res/values/dimens.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 14sp 4 | 4dp 5 | 12dp 6 | 80dp 7 | -------------------------------------------------------------------------------- /sample/src/main/res/values/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | UI Components 3 | Most users recommend buying the product in your own size. 4 | 5 | -------------------------------------------------------------------------------- /sample/src/main/res/values/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 12 | 13 | 21 | 22 | -------------------------------------------------------------------------------- /settings.gradle.kts: -------------------------------------------------------------------------------- 1 | include(":sample") 2 | include(":sample-compose") 3 | include(":libraries:rating-bar") 4 | include(":libraries:dialogs") 5 | include(":libraries:image-slider") 6 | include(":libraries:phonenumber") 7 | include(":libraries:toolbar") 8 | include(":libraries:suggestion-input-view") 9 | include(":libraries:card-input-view") 10 | include(":libraries:quantity-picker-view") 11 | include(":libraries:quantity-picker-compose") 12 | include(":libraries:timeline-view") 13 | include(":libraries:touch-delegator") 14 | include(":libraries:fit-option-message-view") 15 | include(":libraries:timeline-view-compose") 16 | include(":libraries:rating-bar-compose") 17 | 18 | rootProject.name = "trendyol-android-ui-components" 19 | 20 | enableFeaturePreview("TYPESAFE_PROJECT_ACCESSORS") 21 | --------------------------------------------------------------------------------