Skip to content

Commit

Permalink
End migration components (Toolbar, Lists and Scaffolds)
Browse files Browse the repository at this point in the history
  • Loading branch information
jeluchu committed Jan 15, 2023
1 parent 87f1eb3 commit bf0c7d0
Show file tree
Hide file tree
Showing 49 changed files with 425 additions and 538 deletions.
2 changes: 1 addition & 1 deletion app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ android {
minSdk 22
targetSdk 33
versionCode 1
versionName "1.0"
versionName "1.0.0"

testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
Expand Down
10 changes: 8 additions & 2 deletions app/src/main/java/com/jeluchu/composer/MainActivity.kt
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
package com.jeluchu.composer

import android.os.Bundle
import android.widget.SearchView
import androidx.activity.ComponentActivity
import androidx.activity.compose.setContent
import androidx.compose.foundation.Image
Expand All @@ -34,8 +33,9 @@ import com.jeluchu.jchucomponents.ui.animations.lists.animateItem
import com.jeluchu.jchucomponents.ui.composables.cards.DebutCard
import com.jeluchu.jchucomponents.ui.composables.cards.PostCardTop
import com.jeluchu.jchucomponents.ui.composables.cards.StoryCard
import com.jeluchu.jchucomponents.ui.migration.sheets.BottomSheetWithCloseDialog
import com.jeluchu.jchucomponents.ui.composables.sheets.BottomSheetWithCloseDialog
import com.jeluchu.jchucomponents.ui.composables.textfields.SearchTextField
import com.jeluchu.jchucomponents.ui.composables.toolbars.Toolbar
import com.jeluchu.jchucomponents.ui.themes.darkPastelBlue

class MainActivity : ComponentActivity() {
Expand Down Expand Up @@ -65,6 +65,12 @@ class MainActivity : ComponentActivity() {
horizontalAlignment = Alignment.CenterHorizontally
) {

Toolbar(
modifier = Modifier,
title = "Villagers",
navigateToBackScreen = { }
)

val textState = remember { mutableStateOf(String.empty()) }
SearchTextField(state = textState)

Expand Down
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ buildscript {
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:7.4.0'
classpath libs.com.android.tools.build.gradle
classpath libs.org.jetbrains.kotlin.kotlin.gradle.plugin
classpath libs.org.jetbrains.dokka.dokka.gradle.plugin
}
Expand Down
2 changes: 1 addition & 1 deletion gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ com-google-firebase-firebase-analytics-ktx = "com.google.firebase:firebase-analy
com-google-code-gson = "com.google.code.gson:gson:2.10"
com-google-android-gms-play-services-base = "com.google.android.gms:play-services-base:18.1.0"
com-google-accompanist-accompanist-systemuicontroller = { module = "com.google.accompanist:accompanist-systemuicontroller", version.ref = "com-google-accompanist" }
com-android-tools-build-gradle = "com.android.tools.build:gradle:7.3.1"
com-android-tools-build-gradle = "com.android.tools.build:gradle:7.4.0"
androidx-navigation-navigation-compose = { module = "androidx.navigation:navigation-compose", version.ref = "androidx-navigation" }
androidx-preference = "androidx.preference:preference-ktx:1.2.0"
androidx-browser = "androidx.browser:browser:1.4.0"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
package com.jeluchu.jchucomponents

import androidx.test.platform.app.InstrumentationRegistry
import androidx.test.ext.junit.runners.AndroidJUnit4

import androidx.test.platform.app.InstrumentationRegistry
import org.junit.Assert.*
import org.junit.Test
import org.junit.runner.RunWith

import org.junit.Assert.*

/**
* Instrumented test, which will execute on an Android device.
*
Expand Down
1 change: 1 addition & 0 deletions jchucomponents-ktx/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android">

<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
</manifest>
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,6 @@ fun Context.addToClipboard(str: CharSequence?) {
}



/** ---- PRIVATE METHODS ----------------------------------------------------------------------- **/

val Context.layoutInflater
Expand Down Expand Up @@ -99,7 +98,6 @@ fun Context.createQR(
}



/** ---- SAVE IMAGES --------------------------------------------------------------------------- **/

fun Context.saveBitmap(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ inline fun <T, reified R> T.convert(): R = gson.toJson(this).toObject()
/**
* Helps to get Map, List, Set or other generic type from Json using Gson.
*/
inline fun <reified T: Any> Gson.fromJsonToGeneric(json: String): T {
inline fun <reified T : Any> Gson.fromJsonToGeneric(json: String): T {
val type = object : TypeToken<T>() {}.type
return fromJson(json, type)
}
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ fun Float.Companion.empty() = 0f
fun Float?.orEmpty(defaultValue: Float = Float.empty()): Float = this ?: defaultValue

fun Long.Companion.empty() = 0L
fun Long?.orEmpty(defaultValue: Long = Long.empty()): Long = this ?: defaultValue
fun Long?.orEmpty(defaultValue: Long = Long.empty()): Long = this ?: defaultValue

fun Int.milliSecondsToTimer(): String {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,10 @@ object CaesarCypher {
if (c in 'A'..'Z') {
d = c + offset
if (d > 'Z') d -= 26
}
else if (c in 'a'..'z') {
} else if (c in 'a'..'z') {
d = c + offset
if (d > 'z') d -= 26
}
else
} else
d = c
chars[index] = d
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ class SharedPrefsHelpers {
return datalist
}

fun clearSession() {
fun clearSession() {
val editor = mSharedPreferences!!.edit()
editor.clear()
editor.apply()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,9 @@

package com.jeluchu.jchucomponents.ktx.utilities.zxing.qrcode

import com.jeluchu.jchucomponents.ktx.utilities.zxing.BarcodeFormat
import com.jeluchu.jchucomponents.ktx.utilities.zxing.BinaryBitmap
import com.jeluchu.jchucomponents.ktx.utilities.zxing.*
import com.jeluchu.jchucomponents.ktx.utilities.zxing.ChecksumException
import com.jeluchu.jchucomponents.ktx.utilities.zxing.DecodeHintType
import com.jeluchu.jchucomponents.ktx.utilities.zxing.FormatException
import com.jeluchu.jchucomponents.ktx.utilities.zxing.NotFoundException
import com.jeluchu.jchucomponents.ktx.utilities.zxing.Reader
import com.jeluchu.jchucomponents.ktx.utilities.zxing.ResultMetadataType
import com.jeluchu.jchucomponents.ktx.utilities.zxing.ResultPoint
import com.jeluchu.jchucomponents.ktx.utilities.zxing.*
import com.jeluchu.jchucomponents.ktx.utilities.zxing.common.BitMatrix
import com.jeluchu.jchucomponents.ktx.utilities.zxing.common.DecoderResult
import com.jeluchu.jchucomponents.ktx.utilities.zxing.qrcode.decoder.Decoder
Expand Down
6 changes: 3 additions & 3 deletions jchucomponents-ktx/src/main/res/drawable/ic_btn_share.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
android:height="24dp"
android:viewportWidth="24"
android:viewportHeight="24">
<path
android:pathData="M17,3.002a2.998,2.998 0,1 1,-2.148 5.09l-5.457,3.12a3.002,3.002 0,0 1,0 1.577l5.458,3.119a2.998,2.998 0,1 1,-0.746 1.304l-5.457,-3.12a2.998,2.998 0,1 1,0 -4.184l5.457,-3.12A2.998,2.998 0,0 1,17 3.002Z"
android:fillColor="#FFF"/>
<path
android:fillColor="#FFF"
android:pathData="M17,3.002a2.998,2.998 0,1 1,-2.148 5.09l-5.457,3.12a3.002,3.002 0,0 1,0 1.577l5.458,3.119a2.998,2.998 0,1 1,-0.746 1.304l-5.457,-3.12a2.998,2.998 0,1 1,0 -4.184l5.457,-3.12A2.998,2.998 0,0 1,17 3.002Z" />
</vector>
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
package com.jeluchu.jchucomponents

import org.junit.Test

import org.junit.Assert.*
import org.junit.Test

/**
* Example local unit test, which will execute on the development machine (host).
Expand Down
2 changes: 1 addition & 1 deletion jchucomponents-ui/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ afterEvaluate {
from components.release
groupId = "com.github.jeluchu"
artifactId = "jchucomponents-ui"
version = "1.0.0-beta16"
version = "1.0.0-rc01"
}
}
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
package com.jeluchu.jchucomponents

import androidx.test.platform.app.InstrumentationRegistry
import androidx.test.ext.junit.runners.AndroidJUnit4

import androidx.test.platform.app.InstrumentationRegistry
import org.junit.Assert.*
import org.junit.Test
import org.junit.runner.RunWith

import org.junit.Assert.*

/**
* Instrumented test, which will execute on an Android device.
*
Expand Down
2 changes: 1 addition & 1 deletion jchucomponents-ui/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
<manifest>

</manifest>
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,16 @@

package com.jeluchu.jchucomponents.ui.animations.navigation

import androidx.compose.animation.*
import androidx.compose.animation.AnimatedContentScope
import androidx.compose.animation.EnterTransition
import androidx.compose.animation.ExitTransition
import androidx.compose.animation.ExperimentalAnimationApi
import androidx.compose.animation.core.FastOutLinearInEasing
import androidx.compose.animation.core.FastOutSlowInEasing
import androidx.compose.animation.core.tween
import androidx.compose.animation.fadeIn
import androidx.compose.animation.slideInHorizontally
import androidx.compose.animation.slideOutHorizontally
import androidx.navigation.NavBackStackEntry

@ExperimentalAnimationApi
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,18 +10,38 @@ import androidx.compose.animation.core.MutableTransitionState
import androidx.compose.animation.core.animateFloat
import androidx.compose.animation.core.tween
import androidx.compose.animation.core.updateTransition
import androidx.compose.foundation.layout.*
import androidx.compose.foundation.layout.Box
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.ColumnScope
import androidx.compose.foundation.layout.IntrinsicSize
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.layout.width
import androidx.compose.foundation.rememberScrollState
import androidx.compose.foundation.verticalScroll
import androidx.compose.material.*
import androidx.compose.runtime.*
import androidx.compose.material.Card
import androidx.compose.material.DropdownMenu
import androidx.compose.material.MaterialTheme
import androidx.compose.material.Text
import androidx.compose.material.contentColorFor
import androidx.compose.runtime.Composable
import androidx.compose.runtime.Immutable
import androidx.compose.runtime.LaunchedEffect
import androidx.compose.runtime.MutableState
import androidx.compose.runtime.getValue
import androidx.compose.runtime.remember
import androidx.compose.ui.Modifier
import androidx.compose.ui.draw.alpha
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.graphics.takeOrElse
import androidx.compose.ui.graphics.toArgb
import androidx.compose.ui.platform.LocalDensity
import androidx.compose.ui.unit.*
import androidx.compose.ui.unit.Density
import androidx.compose.ui.unit.DpOffset
import androidx.compose.ui.unit.IntOffset
import androidx.compose.ui.unit.IntRect
import androidx.compose.ui.unit.IntSize
import androidx.compose.ui.unit.LayoutDirection
import androidx.compose.ui.unit.dp
import androidx.compose.ui.window.Popup
import androidx.compose.ui.window.PopupPositionProvider
import androidx.compose.ui.window.PopupProperties
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,12 @@ package com.jeluchu.jchucomponents.ui.composables.cards
import androidx.compose.foundation.Image
import androidx.compose.foundation.border
import androidx.compose.foundation.clickable
import androidx.compose.foundation.layout.*
import androidx.compose.foundation.layout.fillMaxHeight
import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.layout.height
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.layout.size
import androidx.compose.foundation.layout.width
import androidx.compose.foundation.shape.CircleShape
import androidx.compose.foundation.shape.RoundedCornerShape
import androidx.compose.material.Card
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,13 @@
package com.jeluchu.jchucomponents.ui.composables.chips

import androidx.compose.foundation.background
import androidx.compose.foundation.layout.*
import androidx.compose.foundation.layout.Box
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.Row
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.layout.size
import androidx.compose.foundation.layout.wrapContentSize
import androidx.compose.foundation.layout.wrapContentWidth
import androidx.compose.foundation.shape.RoundedCornerShape
import androidx.compose.material3.Icon
import androidx.compose.material3.MaterialTheme
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,13 @@ import androidx.compose.foundation.clickable
import androidx.compose.foundation.layout.Row
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.shape.RoundedCornerShape
import androidx.compose.material.icons.Icons
import androidx.compose.material.icons.filled.Check
import androidx.compose.material.icons.filled.HighlightOff
import androidx.compose.material3.Icon
import androidx.compose.material3.MaterialTheme
import androidx.compose.material3.Surface
import androidx.compose.material3.Text
import androidx.compose.material.icons.Icons
import androidx.compose.material.icons.filled.Check
import androidx.compose.material.icons.filled.HighlightOff
import androidx.compose.runtime.Composable
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,12 @@

package com.jeluchu.jchucomponents.ui.composables.loaders

import androidx.compose.animation.core.*
import androidx.compose.animation.core.LinearEasing
import androidx.compose.animation.core.RepeatMode
import androidx.compose.animation.core.animateFloat
import androidx.compose.animation.core.infiniteRepeatable
import androidx.compose.animation.core.rememberInfiniteTransition
import androidx.compose.animation.core.tween
import androidx.compose.foundation.layout.Box
import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.foundation.layout.size
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,12 @@
package com.jeluchu.jchucomponents.ui.composables.pager

import androidx.compose.foundation.background
import androidx.compose.foundation.layout.*
import androidx.compose.foundation.layout.Row
import androidx.compose.foundation.layout.Spacer
import androidx.compose.foundation.layout.height
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.layout.width
import androidx.compose.foundation.layout.wrapContentSize
import androidx.compose.foundation.shape.RoundedCornerShape
import androidx.compose.runtime.Composable
import androidx.compose.ui.Modifier
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,14 @@ package com.jeluchu.jchucomponents.ui.composables.particles

import androidx.compose.animation.AnimatedVisibility
import androidx.compose.animation.ExitTransition
import androidx.compose.animation.core.*
import androidx.compose.animation.core.LinearEasing
import androidx.compose.animation.core.LinearOutSlowInEasing
import androidx.compose.animation.core.MutableTransitionState
import androidx.compose.animation.core.animateFloat
import androidx.compose.animation.core.animateInt
import androidx.compose.animation.core.keyframes
import androidx.compose.animation.core.tween
import androidx.compose.animation.core.updateTransition
import androidx.compose.animation.slideInVertically
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.layout.wrapContentSize
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,11 @@ import androidx.compose.foundation.layout.Box
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.layout.size
import androidx.compose.material3.Icon
import androidx.compose.runtime.*
import androidx.compose.runtime.Composable
import androidx.compose.runtime.LaunchedEffect
import androidx.compose.runtime.MutableState
import androidx.compose.runtime.mutableStateOf
import androidx.compose.runtime.remember
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.graphics.Color
Expand Down
Loading

0 comments on commit bf0c7d0

Please sign in to comment.