-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[sample-gallery-core][INIT]: module initialization fro sample gallery…
… core; [sample-gallery][DEV]: code refactor to adapt to latest project structure;
- Loading branch information
1 parent
1b422e8
commit 4000679
Showing
60 changed files
with
357 additions
and
104 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
/build | ||
apikey.unsplash |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
plugins { | ||
id 'com.android.library' | ||
id 'kotlin-android' | ||
|
||
id("cn.dailystudio.devbricksx.devkit") version "$devkit_version" | ||
} | ||
|
||
android { | ||
compileSdkVersion COMPILE_SDK | ||
buildToolsVersion BUILD_TOOLS | ||
|
||
defaultConfig { | ||
namespace "com.dailystudio.devbricksx.gallery.core" | ||
|
||
minSdkVersion 21 | ||
targetSdkVersion TARGET_SDK | ||
versionCode VERSION_CODE | ||
versionName VERSION_NAME | ||
|
||
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" | ||
|
||
vectorDrawables { | ||
useSupportLibrary = true | ||
} | ||
|
||
resValue "string", "api_key", "${project.UNSPLASH_API_KEY}" | ||
|
||
multiDexEnabled true | ||
} | ||
|
||
buildTypes { | ||
release { | ||
minifyEnabled true | ||
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro' | ||
} | ||
} | ||
|
||
buildFeatures { | ||
buildConfig true | ||
} | ||
|
||
compileOptions { | ||
sourceCompatibility JAVA_VERSION | ||
targetCompatibility JAVA_VERSION | ||
} | ||
|
||
kotlinOptions { | ||
jvmTarget = JVM_TARGET | ||
} | ||
} | ||
|
||
devKit { | ||
compileType = "Project" | ||
devKitComps = [ "Network"] | ||
} | ||
|
||
dependencies { | ||
implementation fileTree(dir: 'libs', include: ['*.jar']) | ||
implementation 'androidx.constraintlayout:constraintlayout:2.1.4' | ||
testImplementation 'junit:junit:4.13.2' | ||
androidTestImplementation 'androidx.test.ext:junit:1.1.5' | ||
androidTestImplementation 'androidx.test.espresso:espresso-core:3.5.1' | ||
|
||
api("io.coil-kt:coil:${project.ext.coilVersion}") | ||
api "com.github.Rasalexman:KDispatcher:${project.ext.kdispatcherVersion}" | ||
} |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
kdispatcherVersion = 1.1.92 | ||
coilVersion = 2.2.2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
# Add project specific ProGuard rules here. | ||
# You can control the set of applied configuration files using the | ||
# proguardFiles setting in build.gradle. | ||
# | ||
# For more details, see | ||
# http://developer.android.com/guide/developing/tools/proguard.html | ||
|
||
# If your project uses WebView with JS, uncomment the following | ||
# and specify the fully qualified class name to the JavaScript interface | ||
# class: | ||
#-keepclassmembers class fqcn.of.javascript.interface.for.webview { | ||
# public *; | ||
#} | ||
|
||
# Uncomment this to preserve the line number information for | ||
# debugging stack traces. | ||
#-keepattributes SourceFile,LineNumberTable | ||
|
||
# If you keep the line number information, uncomment this to | ||
# hide the original source file name. | ||
#-renamesourcefileattribute SourceFile |
24 changes: 24 additions & 0 deletions
24
...e/src/androidTest/java/com/dailystudio/devbricksx/gallery/core/ExampleInstrumentedTest.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
package com.dailystudio.devbricks.gallery.core | ||
|
||
import androidx.test.platform.app.InstrumentationRegistry | ||
import androidx.test.ext.junit.runners.AndroidJUnit4 | ||
|
||
import org.junit.Test | ||
import org.junit.runner.RunWith | ||
|
||
import org.junit.Assert.* | ||
|
||
/** | ||
* Instrumented test, which will execute on an Android device. | ||
* | ||
* See [testing documentation](http://d.android.com/tools/testing). | ||
*/ | ||
@RunWith(AndroidJUnit4::class) | ||
class ExampleInstrumentedTest { | ||
@Test | ||
fun useAppContext() { | ||
// Context of the app under test. | ||
val appContext = InstrumentationRegistry.getInstrumentation().targetContext | ||
assertEquals("com.dailystudio.devbricks.gallery.core.test", appContext.packageName) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<manifest/> |
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<!-- | ||
/* //device/apps/common/res/anim/slide_in_left.xml | ||
** | ||
** Copyright 2007, The Android Open Source Project | ||
** | ||
** Licensed under the Apache License, Version 2.0 (the "License"); | ||
** you may not use this file except in compliance with the License. | ||
** You may obtain a copy of the License at | ||
** | ||
** http://www.apache.org/licenses/LICENSE-2.0 | ||
** | ||
** Unless required by applicable law or agreed to in writing, software | ||
** distributed under the License is distributed on an "AS IS" BASIS, | ||
** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
** See the License for the specific language governing permissions and | ||
** limitations under the License. | ||
*/ | ||
--> | ||
|
||
<set xmlns:android="http://schemas.android.com/apk/res/android"> | ||
<translate android:fromXDelta="-50%p" android:toXDelta="0" | ||
android:duration="@integer/animLength"/> | ||
<alpha android:fromAlpha="0.0" android:toAlpha="1.0" | ||
android:duration="@integer/animLength" /> | ||
</set> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<!-- | ||
/* //device/apps/common/res/anim/slide_in_left.xml | ||
** | ||
** Copyright 2007, The Android Open Source Project | ||
** | ||
** Licensed under the Apache License, Version 2.0 (the "License"); | ||
** you may not use this file except in compliance with the License. | ||
** You may obtain a copy of the License at | ||
** | ||
** http://www.apache.org/licenses/LICENSE-2.0 | ||
** | ||
** Unless required by applicable law or agreed to in writing, software | ||
** distributed under the License is distributed on an "AS IS" BASIS, | ||
** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
** See the License for the specific language governing permissions and | ||
** limitations under the License. | ||
*/ | ||
--> | ||
|
||
<set xmlns:android="http://schemas.android.com/apk/res/android"> | ||
<translate android:fromXDelta="150%p" android:toXDelta="0" | ||
android:duration="@integer/animLength"/> | ||
<alpha android:fromAlpha="0.0" android:toAlpha="1.0" | ||
android:duration="@integer/animLength" /> | ||
</set> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<!-- | ||
/* //device/apps/common/res/anim/slide_in_left.xml | ||
** | ||
** Copyright 2007, The Android Open Source Project | ||
** | ||
** Licensed under the Apache License, Version 2.0 (the "License"); | ||
** you may not use this file except in compliance with the License. | ||
** You may obtain a copy of the License at | ||
** | ||
** http://www.apache.org/licenses/LICENSE-2.0 | ||
** | ||
** Unless required by applicable law or agreed to in writing, software | ||
** distributed under the License is distributed on an "AS IS" BASIS, | ||
** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
** See the License for the specific language governing permissions and | ||
** limitations under the License. | ||
*/ | ||
--> | ||
|
||
<set xmlns:android="http://schemas.android.com/apk/res/android"> | ||
<translate android:fromXDelta="0" android:toXDelta="-50%p" | ||
android:duration="@integer/animLength"/> | ||
<alpha android:fromAlpha="1.0" android:toAlpha="0.0" | ||
android:duration="@integer/animLength" /> | ||
</set> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<!-- | ||
/* //device/apps/common/res/anim/slide_in_left.xml | ||
** | ||
** Copyright 2007, The Android Open Source Project | ||
** | ||
** Licensed under the Apache License, Version 2.0 (the "License"); | ||
** you may not use this file except in compliance with the License. | ||
** You may obtain a copy of the License at | ||
** | ||
** http://www.apache.org/licenses/LICENSE-2.0 | ||
** | ||
** Unless required by applicable law or agreed to in writing, software | ||
** distributed under the License is distributed on an "AS IS" BASIS, | ||
** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
** See the License for the specific language governing permissions and | ||
** limitations under the License. | ||
*/ | ||
--> | ||
|
||
<set xmlns:android="http://schemas.android.com/apk/res/android"> | ||
<translate android:fromXDelta="0" android:toXDelta="150%p" | ||
android:duration="@integer/animLength"/> | ||
<alpha android:fromAlpha="1.0" android:toAlpha="0.0" | ||
android:duration="@integer/animLength" /> | ||
</set> |
File renamed without changes.
File renamed without changes.
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
<!--?xml version="1.0" encoding="UTF-8"?--> | ||
<resources> | ||
<color name="primaryColor">#d32f2f</color> | ||
<color name="primaryLightColor">#ff6659</color> | ||
<color name="primaryDarkColor">#9a0007</color> | ||
<color name="secondaryColor">#3949ab</color> | ||
<color name="secondaryLightColor">#6f74dd</color> | ||
<color name="secondaryDarkColor">#00227b</color> | ||
<color name="primaryTextColor">#ffffff</color> | ||
<color name="secondaryTextColor">#ffffff</color> | ||
</resources> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<resources> | ||
<integer name="animLength">400</integer> | ||
</resources> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
|
||
<resources> | ||
|
||
<dimen name="photo_item_padding_h">0dp</dimen> | ||
<dimen name="photo_item_padding_v">0dp</dimen> | ||
|
||
<dimen name="photo_item_title_font_size">12dp</dimen> | ||
<dimen name="photo_item_title_height">150dp</dimen> | ||
<dimen name="photo_item_title_padding_h">6dp</dimen> | ||
<dimen name="photo_item_title_padding_v">6dp</dimen> | ||
<dimen name="photo_item_supporting_font_size">10dp</dimen> | ||
<dimen name="photo_item_supporting_height">80dp</dimen> | ||
|
||
<dimen name="photo_user_name_font_size">18dp</dimen> | ||
<dimen name="photo_source_font_size">14dp</dimen> | ||
<dimen name="photo_download_icon_size">32dp</dimen> | ||
|
||
</resources> |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
<resources> | ||
<string name="app_name">Gallery</string> | ||
<string name="app_desc">This is a sample application written with DevbricksX library. It illustrates how to use the library to compose a gallery app in the most efficient way.\n\nIt shows numerous high-quality images from Unsplash.com. Plus, you can search images on that website with your keywords.\n\nIf you have any problem, please feel free to contact me:\n\n\t\t\tdailystudio2010@gmail.com\n</string> | ||
|
||
<string name="label_author">by %1$s\u00A0</string> | ||
<string name="label_website">unsplash.com\u00A0</string> | ||
|
||
<string name="menu_search">Search</string> | ||
<string name="menu_clear_search">Clear search</string> | ||
<string name="menu_about">About</string> | ||
|
||
<string name="source_unsplash">Unsplash.com</string> | ||
|
||
|
||
</resources> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
<resources xmlns:tools="http://schemas.android.com/tools"> | ||
|
||
<style name="PhotoItemText"> | ||
<item name="android:textStyle">italic</item> | ||
<item name="android:maxLines">1</item> | ||
<item name="android:ellipsize">marquee</item> | ||
</style> | ||
|
||
<style name="PhotoItemTitle" parent="PhotoItemText"> | ||
<item name="android:textSize">@dimen/photo_item_title_font_size</item> | ||
<item name="android:textColor">@color/light_white</item> | ||
<item name="android:gravity">end|bottom</item> | ||
<item name="android:background">@drawable/photo_item_title_background</item> | ||
<item name="android:paddingStart">@dimen/photo_item_title_padding_h</item> | ||
<item name="android:paddingEnd">@dimen/photo_item_title_padding_h</item> | ||
<item name="android:paddingTop">0dp</item> | ||
<item name="android:paddingBottom">@dimen/photo_item_title_padding_v</item> | ||
</style> | ||
|
||
<style name="PhotoItemSupportingText" parent="PhotoItemText"> | ||
<item name="android:textStyle">italic|bold</item> | ||
<item name="android:textSize">@dimen/photo_item_supporting_font_size</item> | ||
<item name="android:textColor">@color/primaryColor</item> | ||
<item name="android:gravity">start|top</item> | ||
<item name="android:background">@drawable/photo_item_supporting_background</item> | ||
<item name="android:paddingStart">@dimen/photo_item_title_padding_h</item> | ||
<item name="android:paddingEnd">@dimen/photo_item_title_padding_h</item> | ||
<item name="android:paddingTop">@dimen/photo_item_title_padding_v</item> | ||
<item name="android:paddingBottom">0dp</item> | ||
</style> | ||
|
||
<style name="UserName"> | ||
<item name="android:gravity">left|center_vertical</item> | ||
<item name="android:textColor">@color/light_black</item> | ||
<item name="android:textSize">@dimen/photo_user_name_font_size</item> | ||
<item name="android:paddingStart">@dimen/default_label_padding</item> | ||
<item name="android:paddingEnd">@dimen/default_label_padding</item> | ||
<item name="android:singleLine">true</item> | ||
<item name="android:ellipsize">end</item> | ||
</style> | ||
|
||
<style name="ImageSource"> | ||
<item name="android:gravity">left|center_vertical</item> | ||
<item name="android:textColor">@color/light_gray</item> | ||
<item name="android:textSize">@dimen/photo_source_font_size</item> | ||
<item name="android:textStyle">italic</item> | ||
<item name="android:paddingStart">@dimen/default_label_padding</item> | ||
<item name="android:paddingEnd">@dimen/default_label_padding</item> | ||
</style> | ||
|
||
</resources> |
Oops, something went wrong.