Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
qihuan92 committed Aug 20, 2021
2 parents c06ea16 + 0a9b7ab commit 53b52f8
Show file tree
Hide file tree
Showing 52 changed files with 1,463 additions and 1,230 deletions.
6 changes: 2 additions & 4 deletions .idea/gradle.xml

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

22 changes: 21 additions & 1 deletion .idea/misc.xml

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

10 changes: 0 additions & 10 deletions .idea/runConfigurations.xml

This file was deleted.

30 changes: 19 additions & 11 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ android {
applicationId "com.qihuan.photowidget"
minSdkVersion 24
targetSdkVersion 30
versionCode 17
versionName "1.16"
versionCode 18
versionName "1.17"

testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
Expand Down Expand Up @@ -65,20 +65,28 @@ android {
}
}

kapt {
arguments {
arg("room.schemaLocation", "$projectDir/schemas")
arg("room.incremental", "true")
arg("room.expandProjection", "true")
}
}

dependencies {
implementation 'androidx.core:core-ktx:1.6.0-alpha03'
implementation 'androidx.core:core-ktx:1.6.0'
implementation "androidx.palette:palette-ktx:1.0.0"
implementation 'androidx.appcompat:appcompat:1.2.0'
implementation 'androidx.appcompat:appcompat:1.3.0'
implementation "androidx.swiperefreshlayout:swiperefreshlayout:1.1.0"
implementation 'androidx.recyclerview:recyclerview:1.2.0'
implementation 'androidx.recyclerview:recyclerview:1.2.1'
implementation 'androidx.constraintlayout:constraintlayout:2.0.4'
testImplementation 'junit:junit:4.13.2'
androidTestImplementation 'androidx.test.ext:junit:1.1.2'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.3.0'
androidTestImplementation 'androidx.test.ext:junit:1.1.3'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0'

implementation 'com.google.android.material:material:1.4.0-beta01'
implementation 'androidx.activity:activity-ktx:1.3.0-alpha07'
implementation 'androidx.fragment:fragment-ktx:1.3.0'
implementation 'com.google.android.material:material:1.4.0'
implementation 'androidx.activity:activity-ktx:1.3.0'
implementation 'androidx.fragment:fragment-ktx:1.3.5'

def paging_version = "3.0.0"
implementation "androidx.paging:paging-runtime-ktx:$paging_version"
Expand All @@ -90,7 +98,7 @@ dependencies {
implementation "androidx.room:room-ktx:$room_version"
testImplementation "androidx.room:room-testing:$room_version"

implementation 'com.github.yalantis:ucrop:2.2.6'
implementation 'com.github.yalantis:ucrop:2.2.7'
implementation 'id.zelory:compressor:3.0.1'

implementation 'com.github.bumptech.glide:glide:4.12.0'
Expand Down
120 changes: 120 additions & 0 deletions app/schemas/com.qihuan.photowidget.db.AppDatabase/7.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,120 @@
{
"formatVersion": 1,
"database": {
"version": 7,
"identityHash": "ce6262fa0879f79d261642614936ffa2",
"entities": [
{
"tableName": "widget_info",
"createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`widgetId` INTEGER NOT NULL, `verticalPadding` REAL NOT NULL, `horizontalPadding` REAL NOT NULL, `widgetRadius` REAL NOT NULL, `widgetTransparency` REAL NOT NULL, `autoPlayInterval` INTEGER, `openUrl` TEXT, `photoScaleType` TEXT NOT NULL, `createTime` INTEGER, PRIMARY KEY(`widgetId`))",
"fields": [
{
"fieldPath": "widgetId",
"columnName": "widgetId",
"affinity": "INTEGER",
"notNull": true
},
{
"fieldPath": "verticalPadding",
"columnName": "verticalPadding",
"affinity": "REAL",
"notNull": true
},
{
"fieldPath": "horizontalPadding",
"columnName": "horizontalPadding",
"affinity": "REAL",
"notNull": true
},
{
"fieldPath": "widgetRadius",
"columnName": "widgetRadius",
"affinity": "REAL",
"notNull": true
},
{
"fieldPath": "widgetTransparency",
"columnName": "widgetTransparency",
"affinity": "REAL",
"notNull": true
},
{
"fieldPath": "autoPlayInterval",
"columnName": "autoPlayInterval",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "openUrl",
"columnName": "openUrl",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "photoScaleType",
"columnName": "photoScaleType",
"affinity": "TEXT",
"notNull": true
},
{
"fieldPath": "createTime",
"columnName": "createTime",
"affinity": "INTEGER",
"notNull": false
}
],
"primaryKey": {
"columnNames": [
"widgetId"
],
"autoGenerate": false
},
"indices": [],
"foreignKeys": []
},
{
"tableName": "widget_image",
"createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`imageId` INTEGER PRIMARY KEY AUTOINCREMENT, `widgetId` INTEGER NOT NULL, `imageUri` TEXT NOT NULL, `createTime` INTEGER NOT NULL)",
"fields": [
{
"fieldPath": "imageId",
"columnName": "imageId",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "widgetId",
"columnName": "widgetId",
"affinity": "INTEGER",
"notNull": true
},
{
"fieldPath": "imageUri",
"columnName": "imageUri",
"affinity": "TEXT",
"notNull": true
},
{
"fieldPath": "createTime",
"columnName": "createTime",
"affinity": "INTEGER",
"notNull": true
}
],
"primaryKey": {
"columnNames": [
"imageId"
],
"autoGenerate": true
},
"indices": [],
"foreignKeys": []
}
],
"views": [],
"setupQueries": [
"CREATE TABLE IF NOT EXISTS room_master_table (id INTEGER PRIMARY KEY,identity_hash TEXT)",
"INSERT OR REPLACE INTO room_master_table (id,identity_hash) VALUES(42, 'ce6262fa0879f79d261642614936ffa2')"
]
}
}
13 changes: 9 additions & 4 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@
android:permission="android.permission.BIND_REMOTEVIEWS" />

<activity
android:name=".MainActivity"
android:name=".main.MainActivity"
android:screenOrientation="portrait">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
Expand All @@ -192,7 +192,7 @@
</activity>

<activity
android:name=".ConfigureActivity"
android:name=".config.ConfigureActivity"
android:excludeFromRecents="true"
android:launchMode="singleTask"
android:screenOrientation="portrait"
Expand All @@ -208,11 +208,16 @@
android:theme="@style/Theme.AppCompat.Light.NoActionBar" />

<activity
android:name=".InstalledAppActivity"
android:name=".crop.CropActivity"
android:screenOrientation="portrait"
android:theme="@style/Theme.AppCompat.Light.NoActionBar" />

<activity
android:name=".link.InstalledAppActivity"
android:screenOrientation="portrait" />

<activity
android:name=".UrlInputActivity"
android:name=".link.UrlInputActivity"
android:screenOrientation="portrait" />
</application>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import android.content.Context
import android.content.Intent
import android.net.Uri
import android.os.Bundle
import android.util.Log
import android.widget.RemoteViews
import com.qihuan.photowidget.bean.WidgetBean
import com.qihuan.photowidget.db.AppDatabase
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,15 @@ package com.qihuan.photowidget.adapter
import android.view.View
import android.widget.TextView
import androidx.core.view.isVisible
import androidx.core.view.updatePadding
import androidx.databinding.BindingAdapter
import androidx.databinding.InverseBindingAdapter
import androidx.databinding.InverseBindingListener
import com.google.android.material.card.MaterialCardView
import com.google.android.material.slider.Slider
import com.qihuan.photowidget.R
import com.qihuan.photowidget.bean.LinkType
import com.qihuan.photowidget.ktx.dp


/**
Expand All @@ -32,6 +35,42 @@ object BindingAdapters {
}
}

@JvmStatic
@BindingAdapter("android:paddingLeft")
fun setPaddingLeft(view: View, value: Float) {
view.updatePadding(left = value.dp)
}

@JvmStatic
@BindingAdapter("android:paddingTop")
fun setPaddingTop(view: View, value: Float) {
view.updatePadding(top = value.dp)
}

@JvmStatic
@BindingAdapter("android:paddingRight")
fun setPaddingRight(view: View, value: Float) {
view.updatePadding(right = value.dp)
}

@JvmStatic
@BindingAdapter("android:paddingBottom")
fun setPaddingBottom(view: View, value: Float) {
view.updatePadding(bottom = value.dp)
}

@JvmStatic
@BindingAdapter("android:alpha")
fun setAlpha(view: View, value: Float) {
view.alpha = value
}

@JvmStatic
@BindingAdapter("cardCornerRadius")
fun setCardCornerRadius(view: MaterialCardView, value: Float) {
view.radius = value.dp.toFloat()
}

@JvmStatic
@BindingAdapter("isVisible")
fun setVisible(view: View, value: Boolean) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import android.view.ViewGroup
import androidx.recyclerview.widget.DiffUtil
import androidx.recyclerview.widget.ListAdapter
import androidx.recyclerview.widget.RecyclerView
import com.bumptech.glide.Glide
import com.qihuan.photowidget.databinding.ItemPreviewPhotoBinding

/**
Expand Down Expand Up @@ -38,7 +39,9 @@ class PreviewPhotoAdapter : ListAdapter<Uri, PreviewPhotoAdapter.ViewHolder>(Dif

fun bind(item: Uri) {
binding.btnDelete.isEnabled = true
binding.ivPicture.setImageURI(item)
Glide.with(itemView.context)
.load(item)
.into(binding.ivPicture)
}
}

Expand Down
13 changes: 0 additions & 13 deletions app/src/main/java/com/qihuan/photowidget/bean/CropPictureInfo.kt

This file was deleted.

Loading

0 comments on commit 53b52f8

Please sign in to comment.