Skip to content

Commit

Permalink
rename package
Browse files Browse the repository at this point in the history
  • Loading branch information
zyyoona7 committed Jun 1, 2018
1 parent d7f1640 commit 3131bb0
Show file tree
Hide file tree
Showing 26 changed files with 64 additions and 69 deletions.
12 changes: 6 additions & 6 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ apply plugin: 'kotlin-android'

android {
compileSdkVersion 25
buildToolsVersion "25.0.1"
buildToolsVersion '27.0.3'
defaultConfig {
applicationId "com.zyyoona7.kextensions"
minSdkVersion 16
Expand All @@ -20,9 +20,9 @@ android {
}

dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:appcompat-v7:25.+'
compile 'com.android.support.constraint:constraint-layout:1.0.2'
compile "org.jetbrains.kotlin:kotlin-stdlib-jre7:$kotlin_version"
compile project(":lib")
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'com.android.support:appcompat-v7:25.+'
implementation 'com.android.support.constraint:constraint-layout:1.0.2'
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
implementation project(":lib")
}
45 changes: 24 additions & 21 deletions app/src/main/java/com/zyyoona7/kextensions/MainActivity.kt
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import android.os.Environment.getExternalStorageDirectory
import android.provider.MediaStore
import android.support.v7.app.AppCompatActivity
import android.widget.Button
import com.zyyoona7.lib.*
import com.zyyoona7.extensions.*
import java.io.File
import java.text.SimpleDateFormat
import java.util.*
Expand All @@ -16,7 +16,7 @@ import java.util.*
class MainActivity : AppCompatActivity() {
val tag = "MainActivity"

lateinit var btnHello:Button
lateinit var btnHello: Button

override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
Expand Down Expand Up @@ -52,25 +52,28 @@ class MainActivity : AppCompatActivity() {
// loge("path=$download \nFile=${getFileName(download)}")
//

// if (ContextCompat.checkSelfPermission(this, android.Manifest.permission.WRITE_EXTERNAL_STORAGE)
// != PackageManager.PERMISSION_GRANTED) {

// } else {
// writeFile()
// }
if (!isPermissionGranted(android.Manifest.permission.WRITE_EXTERNAL_STORAGE)) {
requestPermission(arrayOf(android.Manifest.permission.WRITE_EXTERNAL_STORAGE), 11223)
} else {
writeFile()
}

val cal = Calendar.getInstance()
// val cal = Calendar.getInstance()
// cal.add(Calendar.HOUR_OF_DAY, -25)
// loge(cal.timeInMillis.formatAgoStyleForWeChat())
// loge(cal.timeInMillis.formatAgoStyleForWeibo())
cal.add(Calendar.DATE, 2)
loge("day number of week = ${cal.timeInMillis.dayOfWeek}")

btnHello=findViewById(R.id.btn_hello) as Button
btnHello.setOnClickListener{
requestPermission(arrayOf(Manifest.permission.CAMERA)
, 11223)
}
// cal.add(Calendar.DATE, 2)
// loge("day number of week = ${cal.timeInMillis.dayOfWeek}")
//
// btnHello=findViewById(R.id.btn_hello) as Button
// btnHello.setOnClickListener{
// requestPermission(arrayOf(Manifest.permission.CAMERA)
// , 11223)
// }
val download = publicDownloadDir + "/a.txt"
val encodeStr = "123".base64Encode()
val data = "123"
val key = "45678910"
}

private fun writeFile() {
Expand All @@ -90,18 +93,18 @@ class MainActivity : AppCompatActivity() {
loge(readFileAsString(download))
val destFilePath = publicPictureDir + "/b.txt"
createOrExistsFile(destFilePath)
loge("copy finished ${copyOrMoveFile(download, destFilePath, true)}")
loge("copy finished ${copyOrMoveFile(download, destFilePath, false)}")
// installApp()
}

override fun onRequestPermissionsResult(requestCode: Int, permissions: Array<out String>, grantResults: IntArray) {
super.onRequestPermissionsResult(requestCode, permissions, grantResults)
if (requestCode == 11223) {
// writeFile()
handlePermissionResult(permissions, grantResults,{
handlePermissionResult(permissions, grantResults, {
loge("permissions granted ${isPermissionGranted(Manifest.permission.CAMERA)}")
takePhotoNoCompress()
},{
}, {
loge("permissions denied ${arePermissionAlwaysDenied(*permissions)}")
})
}
Expand All @@ -116,7 +119,7 @@ class MainActivity : AppCompatActivity() {
val file = File(getExternalStorageDirectory(), filename)
// mCurrentPhotoPath = file.absolutePath

val fileUri = getUriFromFile( file)
val fileUri = getUriFromFile(file)

takePictureIntent.putExtra(MediaStore.EXTRA_OUTPUT, fileUri)
startActivityForResult(takePictureIntent, 12345)
Expand Down
7 changes: 4 additions & 3 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
// Top-level build file where you can add configuration options common to all sub-projects/modules.

buildscript {
ext.kotlin_version = '1.1.4-3'
ext.kotlin_version = '1.2.30'
repositories {
jcenter()
google()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.3.3'
classpath 'com.android.tools.build:gradle:3.1.2'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
classpath 'com.github.dcendents:android-maven-gradle-plugin:1.5'
classpath 'com.github.dcendents:android-maven-gradle-plugin:2.0'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
Expand Down
4 changes: 2 additions & 2 deletions gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#Thu Aug 24 14:15:50 CST 2017
#Fri Jun 01 18:20:27 CST 2018
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-3.3-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-4.4-all.zip
10 changes: 5 additions & 5 deletions lib/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ group='com.github.zyyoona7'

android {
compileSdkVersion 25
buildToolsVersion "25.0.1"
buildToolsVersion '27.0.3'

defaultConfig {
minSdkVersion 16
Expand All @@ -25,8 +25,8 @@ android {
}

dependencies {
provided fileTree(dir: 'libs', include: ['*.jar'])
provided 'com.android.support:appcompat-v7:25.+'
provided 'com.android.support:design:25.+'
provided "org.jetbrains.kotlin:kotlin-stdlib-jre7:$kotlin_version"
compileOnly fileTree(dir: 'libs', include: ['*.jar'])
compileOnly 'com.android.support:appcompat-v7:25.+'
compileOnly 'com.android.support:design:25.+'
compileOnly "org.jetbrains.kotlin:kotlin-stdlib-jre7:$kotlin_version"
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.zyyoona7.lib;
package com.zyyoona7.extensions;

import android.content.Context;
import android.support.test.InstrumentationRegistry;
Expand Down
11 changes: 1 addition & 10 deletions lib/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,13 +1,4 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"

package="com.zyyoona7.lib"
>

<application android:allowBackup="true"
android:label="@string/app_name"
android:supportsRtl="true"
>

</application>
package="com.zyyoona7.extensions">

</manifest>
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.zyyoona7.lib
package com.zyyoona7.extensions

import android.app.ActivityManager
import android.app.Fragment
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.zyyoona7.lib
package com.zyyoona7.extensions

import android.annotation.SuppressLint
import java.text.DateFormat
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.zyyoona7.lib.deriator;
package com.zyyoona7.extensions.deriator;

/**
* Stripped-down version of the SHA1PRNG provided by the Crypto provider.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.zyyoona7.lib
package com.zyyoona7.extensions

import android.app.Fragment
import android.content.Context
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.zyyoona7.lib
package com.zyyoona7.extensions

import android.util.Base64
import java.io.File
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package com.zyyoona7.lib
package com.zyyoona7.extensions

import com.zyyoona7.lib.deriator.InsecureSHA1PRNGKeyDerivator
import com.zyyoona7.extensions.deriator.InsecureSHA1PRNGKeyDerivator
import java.io.ByteArrayOutputStream
import java.io.File
import java.io.FileInputStream
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.zyyoona7.lib
package com.zyyoona7.extensions

import android.app.Fragment
import android.content.Context
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.zyyoona7.lib
package com.zyyoona7.extensions

import android.app.Fragment
import android.content.Context
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.zyyoona7.lib
package com.zyyoona7.extensions

import android.app.Activity
import android.app.Fragment
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.zyyoona7.lib
package com.zyyoona7.extensions

import android.app.Activity
import android.app.Fragment
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.zyyoona7.lib.log
package com.zyyoona7.extensions.log

import android.util.Log
import org.json.JSONArray
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package com.zyyoona7.lib
package com.zyyoona7.extensions

import com.zyyoona7.lib.log.ZLog
import com.zyyoona7.extensions.log.ZLog

/**
* Created by zyyoona7 on 2017/8/24.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.zyyoona7.lib
package com.zyyoona7.extensions

import android.app.Fragment
import android.content.Context
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.zyyoona7.lib
package com.zyyoona7.extensions

import android.app.Activity
import android.app.Fragment
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.zyyoona7.lib
package com.zyyoona7.extensions

import android.app.Fragment
import android.content.Context
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.zyyoona7.lib
package com.zyyoona7.extensions

import android.support.annotation.StringRes
import android.support.design.widget.Snackbar
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.zyyoona7.lib
package com.zyyoona7.extensions

import android.accounts.AccountManager
import android.annotation.SuppressLint
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.zyyoona7.lib
package com.zyyoona7.extensions

import android.app.Fragment
import android.content.Context
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.zyyoona7.lib
package com.zyyoona7.extensions

import android.os.Build
import android.view.View
Expand Down

0 comments on commit 3131bb0

Please sign in to comment.