Skip to content

Commit

Permalink
Continue reworking repos, lib updates, permissions for gradlew, workf…
Browse files Browse the repository at this point in the history
…low dispatch and other small stuff
  • Loading branch information
AkosPaha01 committed Dec 21, 2021
1 parent 97e44f8 commit 750829a
Show file tree
Hide file tree
Showing 14 changed files with 56 additions and 45 deletions.
11 changes: 9 additions & 2 deletions .github/workflows/buildCi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ on:
- 'gradle.properties'
- 'settings.gradle.kts'
- '.github/workflows/buildCi.yml'
workflow_dispatch:

jobs:
buildMaster:
Expand Down Expand Up @@ -53,11 +54,14 @@ jobs:
run: echo "::set-output name=BRANCH_NAME::$(echo ${GITHUB_REF#refs/heads/} | sed 's/\//_/g')"
id: extract_branch

- name: File Permissions
run: chmod +x gradlew

- name: Build apk
id: buildAllApks
uses: gradle/gradle-build-action@v2
with:
gradle-version: release-candidate
gradle-version: wrapper
arguments: assembleDebug

- name: Get JSON
Expand Down Expand Up @@ -168,11 +172,14 @@ jobs:
run: echo "::set-output name=BRANCH_NAME::$(echo ${GITHUB_REF#refs/heads/} | sed 's/\//_/g')"
id: extract_branch

- name: File Permissions
run: chmod +x gradlew

- name: Build apk
id: buildAllApks
uses: gradle/gradle-build-action@v2
with:
gradle-version: release-candidate
gradle-version: wrapper
arguments: assembleRelease

- name: Get JSON
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/pullRequest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ jobs:
id: buildAllApks
uses: eskatos/gradle-command-action@v1.3.3
with:
gradle-version: current
gradle-version: wrapper
wrapper-cache-enabled: true
dependencies-cache-enabled: true
configuration-cache-enabled: true
Expand Down
17 changes: 0 additions & 17 deletions .idea/deploymentTargetDropDown.xml

This file was deleted.

5 changes: 5 additions & 0 deletions .idea/jarRepositories.xml

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

1 change: 1 addition & 0 deletions .idea/misc.xml

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

2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,5 @@
[![Download rCompatible](https://img.shields.io/github/downloads/DerTyp7214/RboardThemeManagerV3/latest-rCompatible/total)](https://github.com/DerTyp7214/RboardThemeManagerV3/releases/tag/latest-rCompatible)
[![Download Apk](https://img.shields.io/badge/dynamic/json.svg?label=download&url=https://api.github.com/repos/DerTyp7214/RboardThemeManagerV3/releases/tags/latest-rCompatible&query=$.assets[0].name)](https://github.com/DerTyp7214/RboardThemeManagerV3/releases/download/latest-rCompatible/app-release.apk)
[![Build R Compatible](https://github.com/DerTyp7214/RboardThemeManagerV3/actions/workflows/buildRCompatible.yml/badge.svg?branch=rCompatible)](https://github.com/DerTyp7214/RboardThemeManagerV3/actions/workflows/buildCi.yml?query=branch%3ArCompatible)

[Project-page](https://github.com/GboardThemes)
18 changes: 9 additions & 9 deletions app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -55,13 +55,13 @@ android {
}

dependencies {
implementation(platform("com.google.firebase:firebase-bom:29.0.2"))
implementation(platform("com.google.firebase:firebase-bom:29.0.3"))
implementation("com.google.firebase:firebase-messaging-ktx:23.0.0")
implementation("com.google.firebase:firebase-analytics-ktx:20.0.1")
implementation("com.google.firebase:firebase-analytics-ktx:20.0.2")

implementation("androidx.legacy:legacy-support-v4:1.0.0")
implementation("androidx.navigation:navigation-fragment-ktx:2.4.0-beta02")
implementation("androidx.navigation:navigation-ui-ktx:2.4.0-beta02")
implementation("androidx.navigation:navigation-fragment-ktx:2.4.0-rc01")
implementation("androidx.navigation:navigation-ui-ktx:2.4.0-rc01")
implementation("org.apache.commons:commons-text:1.9")

implementation("com.github.topjohnwu.libsu:core:$libsuVersion")
Expand All @@ -71,19 +71,19 @@ dependencies {
implementation("androidx.core:core-ktx:1.7.0")
//noinspection DifferentStdlibGradleVersion
implementation("org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.6.10")
implementation("androidx.appcompat:appcompat:1.3.1")
implementation("androidx.core:core:1.7.0")
implementation("com.google.android.material:material:1.6.0-alpha01")
implementation("androidx.constraintlayout:constraintlayout:2.1.2")
implementation("androidx.preference:preference-ktx:1.2.0-beta01")
implementation("androidx.preference:preference-ktx:1.2.0-rc01")
implementation("androidx.activity:activity-ktx:1.4.0")
implementation("androidx.fragment:fragment-ktx:1.4.0")
implementation("com.jaredrummler:android-shell:1.0.0")
implementation("com.google.firebase:firebase-analytics:20.0.1")
implementation("com.google.firebase:firebase-analytics:20.0.2")
implementation("com.google.firebase:firebase-messaging:23.0.0")
implementation("com.google.code.gson:gson:2.8.9")
implementation("com.bignerdranch.android:simple-item-decoration:1.0.0")
implementation("de.dertyp7214:PRDownloader:v0.6.0")
implementation("com.github.skydoves:balloon:1.4.0")
implementation("com.github.skydoves:balloon:1.4.1")
testImplementation("junit:junit:4.13.2")
androidTestImplementation("androidx.test.ext:junit:1.1.4-alpha03")
androidTestImplementation("androidx.test.espresso:espresso-core:3.5.0-alpha03")
Expand All @@ -94,6 +94,6 @@ dependencies {
implementation("com.github.murgupluoglu:flagkit-android:1.0.2")
implementation(fileTree(mapOf("dir" to "libs", "include" to listOf("*.jar", "*.aar"))))

debugImplementation("androidx.compose.ui:ui-tooling:1.1.0-beta04")
debugImplementation("androidx.compose.ui:ui-tooling:1.1.0-rc01")
implementation("org.jetbrains.kotlin:kotlin-reflect:1.6.10")
}
3 changes: 3 additions & 0 deletions app/src/main/java/de/dertyp7214/rboardthememanager/Config.kt
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,9 @@ object Config {
)
val REPOS = ArrayList(PACKS_URLS)

// TODO: add repo button should load list of verified repos
const val REPOS_LIST_URL =
"https://raw.githubusercontent.com/GboardThemes/Repositories/main/repos.json"
const val SOUNDS_PACKS_URL =
"https://raw.githubusercontent.com/GboardThemes/Soundpack/master/download_sounds.json"

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package de.dertyp7214.rboardthememanager.adapter

import android.annotation.SuppressLint
import android.app.Activity
import android.content.Intent
import android.view.LayoutInflater
Expand Down Expand Up @@ -33,8 +34,8 @@ class ThemePackAdapter(
val lastUpdate: TextView = v.findViewById(R.id.lastUpdate)
}

class NewsViewHolder(v: View) : RecyclerView.ViewHolder(v) {
val newsCards: NewsCards = v as NewsCards
class NewsViewHolder(v: NewsCards) : RecyclerView.ViewHolder(v) {
val newsCards: NewsCards = v
}

override fun getItemId(position: Int): Long {
Expand All @@ -46,12 +47,19 @@ class ThemePackAdapter(
return ViewHolder(LayoutInflater.from(activity).inflate(R.layout.pack_item, parent, false))
}

@SuppressLint("SetTextI18n")
override fun onBindViewHolder(holder: RecyclerView.ViewHolder, position: Int) {
val themePack = list[position]

if (holder is ViewHolder) {
holder.size.text =
themePack.size.zeroOrElse { it.toHumanReadableBytes(activity) } ?: ""
"${themePack.themes?.size?.let { "($it)" } ?: ""} ${
themePack.size.zeroOrElse {
it.toHumanReadableBytes(
activity
)
} ?: ""
}"
holder.title.text = themePack.name
holder.author.text = themePack.author
holder.lastUpdate.text = themePack.date.format(System.currentTimeMillis())
Expand Down Expand Up @@ -98,7 +106,7 @@ class ThemePackAdapter(
}
}

override fun getItemViewType(position: Int): Int = position
override fun getItemViewType(position: Int): Int = if (list[position].none) 0 else 1

override fun getItemCount(): Int = list.size
}
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,7 @@ class NewsCards(context: Context, attrs: AttributeSet? = null) : LinearLayout(co
init {
inflate(context, R.layout.news_card, this)

newsFeedAdapter = NewsFeedAdapter(cards) {
clickNewsListener(it)
}
newsFeedAdapter = NewsFeedAdapter(cards, clickNewsListener)
recyclerView = findViewById(R.id.recyclerViewNews)

val snapHelper = LinearSnapHelper()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -111,13 +111,7 @@ class Repos(
fab.setImageDrawable(ContextCompat.getDrawable(activity, R.drawable.ic_baseline_add_24))
fab.setOnClickListener {
activity.openInputDialog(R.string.repository) { dialog, text ->
doAsync({
try {
"true:$text".parseRepo()
} catch (e: Exception) {
null
}
}) {
doAsync("true:$text"::parseRepo) {
dialog.dismiss()
if (it != null) {
repositories.add(it)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,11 @@ import de.dertyp7214.rboardthememanager.R
import de.dertyp7214.rboardthememanager.adapter.ManageRepoThemePackAdapter
import de.dertyp7214.rboardthememanager.components.LayoutManager
import de.dertyp7214.rboardthememanager.core.getTextFromUrl
import de.dertyp7214.rboardthememanager.core.safeParse
import de.dertyp7214.rboardthememanager.data.ThemePack
import de.dertyp7214.rboardthememanager.databinding.ActivityManageRepoBinding
import de.dertyp7214.rboardthememanager.utils.doAsync
import org.json.JSONObject
import java.net.URL

class ManageRepo : AppCompatActivity() {
Expand Down Expand Up @@ -84,6 +86,14 @@ class ManageRepo : AppCompatActivity() {
items.addAll(themes)
adapter.notifyDataSetChanged()
}

doAsync(URL(key.replace("list.json", "meta.json"))::getTextFromUrl) { text ->
if (text.isNotEmpty()) {
JSONObject().safeParse(text).getString("name").let { name ->
if (name.isNotEmpty()) toolbar.title = name
}
}
}
}

private fun setAction(action: Action) {
Expand Down
2 changes: 1 addition & 1 deletion build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ buildscript {
mavenCentral()
}
dependencies {
classpath("com.android.tools.build:gradle:7.2.0-alpha05")
classpath("com.android.tools.build:gradle:7.2.0-alpha06")
//noinspection DifferentKotlinGradleVersion
classpath(kotlin("gradle-plugin", version = "1.6.0"))
classpath("com.google.gms:google-services:4.3.10")
Expand Down
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#Tue Dec 07 07:49:33 CET 2021
distributionBase=GRADLE_USER_HOME
distributionUrl=https\://services.gradle.org/distributions-snapshots/gradle-7.4-20211214231059+0000-all.zip
distributionUrl=https\://services.gradle.org/distributions-snapshots/gradle-7.4-20211220231647+0000-all.zip
distributionPath=wrapper/dists
zipStorePath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME

0 comments on commit 750829a

Please sign in to comment.