Skip to content

Commit

Permalink
提交一点东西
Browse files Browse the repository at this point in the history
111
  • Loading branch information
mzhd committed Jun 21, 2023
1 parent 240888f commit 2613e43
Show file tree
Hide file tree
Showing 186 changed files with 7,150 additions and 347 deletions.
Binary file modified .idea/caches/build_file_checksums.ser
Binary file not shown.
10 changes: 10 additions & 0 deletions .idea/compiler.xml

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

8 changes: 7 additions & 1 deletion .idea/gradle.xml

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

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

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

20 changes: 17 additions & 3 deletions .idea/misc.xml

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

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

This file was deleted.

Binary file added T.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 2 additions & 0 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ android {
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
namespace 'com.mzyl.album'
}

dependencies {
Expand All @@ -30,6 +31,7 @@ dependencies {
implementation 'com.squareup.okhttp3:okhttp:3.10.0'
implementation 'com.android.support:exifinterface:27.1.1'
implementation 'com.android.support:design:27.1.1'
implementation 'com.github.Almeros:android-gesture-detectors:v1.0'
}

repositories{
Expand Down
19 changes: 15 additions & 4 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.mzyl.album">
<manifest xmlns:android="http://schemas.android.com/apk/res/android">

<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"/>
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
Expand All @@ -11,13 +10,25 @@
android:label="@string/app_name"
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="@style/AppTheme">
<activity android:name=".MainActivity">
android:theme="@style/AppTheme"
android:name=".MyApplication"
android:hardwareAccelerated="false"
>
<activity android:name=".MainActivity"
android:theme="@style/Activity">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>

<activity android:name=".PreviewActivity"
android:theme="@style/Activity"
/>
<activity android:name=".EditActivity"
android:theme="@style/Activity">

</activity>
</application>

</manifest>
58 changes: 58 additions & 0 deletions app/src/main/java/com/mzyl/album/CircleView.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
package com.mzyl.album;

import android.content.Context;
import android.graphics.Canvas;
import android.graphics.Color;
import android.graphics.Paint;
import android.support.annotation.Nullable;
import android.util.AttributeSet;
import android.view.View;
import android.view.ViewGroup;

/**
* Created by mzyl on 2018/3/27.
*/

public class CircleView extends View {
int randius;
int color;

public CircleView(Context context) {
this(context, null);
}

public CircleView(Context context, @Nullable AttributeSet attrs) {
this(context, attrs, 0);
}

public CircleView(Context context, @Nullable AttributeSet attrs, int defStyleAttr) {
super(context, attrs, defStyleAttr);
init();
}

@Override
protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
super.onMeasure(widthMeasureSpec, heightMeasureSpec);
randius = getMeasuredWidth() / 2;
}

private void init() {
color = Color.BLACK;
}

@Override
protected void onDraw(Canvas canvas) {
Paint paint = new Paint();
paint.setAntiAlias(true);
paint.setColor(color);
paint.setStrokeWidth(0);
paint.setStyle(Paint.Style.FILL_AND_STROKE);
canvas.drawCircle(randius, randius, randius, paint);
super.onDraw(canvas);
}

public void changeColor(int color) {
this.color = color;
invalidate();
}
}
38 changes: 38 additions & 0 deletions app/src/main/java/com/mzyl/album/CustomCheckBox.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
package com.mzyl.album;

import android.content.Context;
import android.graphics.Canvas;
import android.graphics.drawable.Drawable;
import android.support.v7.widget.AppCompatCheckBox;
import android.util.AttributeSet;
import android.view.Gravity;

public class CustomCheckBox extends AppCompatCheckBox {
private static final String TAG = CustomCheckBox.class.getSimpleName();

public CustomCheckBox(Context context) {
super(context);
}

public CustomCheckBox(Context context, AttributeSet attrs) {
super(context, attrs);
}

public CustomCheckBox(Context context, AttributeSet attrs, int defStyleAttr) {
super(context, attrs, defStyleAttr);
}

@Override
protected void onDraw(Canvas canvas) {
super.onDraw(canvas);
Drawable[] drawables = getCompoundDrawables();
Drawable drawable = drawables[0];
int gravity = getGravity();
int left = 0;
if (gravity == Gravity.CENTER) {
left = ((int) (getWidth() - drawable.getIntrinsicWidth() - getPaint().measureText(getText().toString()))
/ 2);
}
drawable.setBounds(left, 0, left + drawable.getIntrinsicWidth(), drawable.getIntrinsicHeight());
}
}
Loading

0 comments on commit 2613e43

Please sign in to comment.