Skip to content

Commit

Permalink
first release????
Browse files Browse the repository at this point in the history
  • Loading branch information
AsyJAIZ committed Aug 23, 2023
1 parent 71ec508 commit 9035eda
Show file tree
Hide file tree
Showing 138 changed files with 9,774 additions and 285 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
/.idea/workspace.xml
/.idea/navEditor.xml
/.idea/assetWizardSettings.xml
/.git1
.DS_Store
/build
/captures
Expand Down
2 changes: 1 addition & 1 deletion .idea/gradle.xml

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

3 changes: 2 additions & 1 deletion app/.gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
/build
/build
/libs
1 change: 1 addition & 0 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,5 @@ android {

dependencies {
implementation 'androidx.constraintlayout:constraintlayout:2.1.4'
compileOnly(files("libs/mainsysui33.jar"))
}
8 changes: 8 additions & 0 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,14 @@
<category android:name="android.intent.category.LAUNCHER"/>
</intent-filter>
</activity>
<activity android:theme="@style/Theme.DialogWhenLarge" android:label="@string/unlock_effect" android:name="com.aj.effect.UnlockEffect" android:uiOptions="none"
android:exported="true">
<intent-filter>
<action android:name="android.intent.action.MAIN"/>
<action android:name="com.samsung.settings.UnlockEffect"/>
<category android:name="android.intent.category.DEFAULT"/>
</intent-filter>
</activity>
</application>

</manifest>
49 changes: 49 additions & 0 deletions app/src/main/java/com/aj/effect/EffectEnum.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
package com.aj.effect;

import com.android.keyguard.sec.KeyguardEffectViewController;

import java.util.Arrays;
import java.util.List;

public class EffectEnum {
public int name;
public int assigned;
public int drawable;

public EffectEnum(Integer name, int assigned, Integer drawable)
{
this.name = name == null ? R.string.unlock_effect : name;
this.assigned = assigned > 15 ? KeyguardEffectViewController.EFFECT_MONTBLANC : assigned; // TODO default effect
this.drawable = drawable == null ? R.drawable.setting_preview_unlock_none : drawable;
}

public static final EffectEnum NONE = new EffectEnum(R.string.unlock_effect_none, 0, null);
public static final EffectEnum RIPPLE = new EffectEnum(R.string.unlock_effect_ripple, 1, R.drawable.setting_preview_unlock_ripple);
public static final EffectEnum LIGHTING = new EffectEnum(R.string.light_effect, 2, R.drawable.setting_preview_unlock_light);
public static final EffectEnum POPPINGCOLOURS = new EffectEnum(R.string.unlock_effect_popping, 3, R.drawable.setting_preview_unlock_poppingcolor);
public static final EffectEnum WATERCOLOUR = new EffectEnum(R.string.unlock_effect_watercolor, 4, R.drawable.setting_preview_unlock_watercolor);
public static final EffectEnum BLIND = new EffectEnum(R.string.blind_effect, 5, R.drawable.setting_preview_unlock_blind);
public static final EffectEnum EFFECT_MASS_TENSION = new EffectEnum(null, KeyguardEffectViewController.EFFECT_MASS_TENSION, null); // TODO: tension
public static final EffectEnum EFFECT_MASS_RIPPLE = new EffectEnum(R.string.unlock_effect_simple_ripple, 7, R.drawable.setting_preview_unlock_stoneskipping);
public static final EffectEnum BRILLIANTRING = new EffectEnum(R.string.unlock_effect_brilliant_ring, 8, R.drawable.setting_preview_unlock_brilliantring);
public static final EffectEnum BRILLIANTCUT = new EffectEnum(R.string.brilliant_cut, 9, R.drawable.setting_preview_unlock_brilliantcut);
public static final EffectEnum INDIGODIFFUSION = new EffectEnum(R.string.unlock_effect_montblanc, 10, R.drawable.setting_preview_unlock_montblanc);
public static final EffectEnum ABSTRACTTILES = new EffectEnum(R.string.unlock_effect_abstract, 11, R.drawable.setting_preview_unlock_abstract_tiles);
public static final EffectEnum GEOMETRICMOSAIC = new EffectEnum(R.string.unlock_effect_geometric_mosaic, 12, R.drawable.setting_preview_unlock_geometric_mosaic);
public static final EffectEnum WATERDROPLET = new EffectEnum(R.string.unlock_effect_liquid, 13, R.drawable.setting_preview_unlock_liquid_w); // TODO lowres waterdroplet drawable
public static final EffectEnum SPARKLINGBUBBLES = new EffectEnum(R.string.unlock_effect_particle, 14, R.drawable.setting_preview_unlock_particle);
public static final EffectEnum COLOURDROPLET = new EffectEnum(R.string.unlock_effect_colour_droplet, 15, R.drawable.setting_preview_unlock_liquid);

private static final List<EffectEnum> effectList = Arrays.asList(NONE,
RIPPLE, LIGHTING, POPPINGCOLOURS, WATERCOLOUR, BLIND, EFFECT_MASS_TENSION,
EFFECT_MASS_RIPPLE, BRILLIANTRING, BRILLIANTCUT, INDIGODIFFUSION, ABSTRACTTILES,
GEOMETRICMOSAIC, WATERDROPLET, SPARKLINGBUBBLES, COLOURDROPLET);

public static EffectEnum getByInt(int assigned) {
for (EffectEnum e : effectList) {
if (e.assigned == assigned)
return e;
}
return INDIGODIFFUSION; // TODO DEFAULT EFFECT;
}
}
11 changes: 0 additions & 11 deletions app/src/main/java/com/aj/effect/EffectHelper.java

This file was deleted.

68 changes: 44 additions & 24 deletions app/src/main/java/com/aj/effect/MainActivity.java
Original file line number Diff line number Diff line change
@@ -1,7 +1,12 @@
package com.aj.effect;

import static android.content.Intent.FLAG_ACTIVITY_CLEAR_TOP;
import static android.content.Intent.FLAG_ACTIVITY_SINGLE_TOP;

import android.annotation.SuppressLint;
import android.app.Activity;
import android.content.Context;
import android.content.Intent;
import android.graphics.Bitmap;
import android.graphics.Canvas;
import android.graphics.drawable.Drawable;
Expand All @@ -13,8 +18,8 @@
import android.widget.Button;
import android.widget.FrameLayout;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.Switch;
import android.widget.TextView;

import com.android.keyguard.sec.KeyguardEffectViewController;
import com.android.keyguard.sec.KeyguardUnlockView;
Expand All @@ -25,7 +30,10 @@ public class MainActivity extends Activity {
public static Canvas canv;
public static Button multiactionButton;
public static boolean unlockBool;
public static int effect;

public static int effect = KeyguardEffectViewController.EFFECT_MONTBLANC;

ImageView imgView;

KeyguardEffectViewController controller;
KeyguardUnlockView mUnlockView;
Expand Down Expand Up @@ -60,8 +68,7 @@ protected void onCreate(Bundle savedInstanceState) {

setContentView(R.layout.activity_main);

LinearLayout layout = findViewById(R.id.buttons);
ImageView imgView = findViewById(R.id.imageView);
imgView = findViewById(R.id.imageView);

controller = KeyguardEffectViewController.getInstance(this);
mUnlockView = findViewById(R.id.keyguard_unlock_view);
Expand All @@ -82,16 +89,17 @@ protected void onCreate(Bundle savedInstanceState) {
Drawable realWall = getDrawable(R.drawable.bluesky); //wallpaperManager.getFastDrawable();
Drawable wall = getDrawable(R.drawable.wall);
Drawable wall1 = getDrawable(R.drawable.wall1);
Drawable prev = getDrawable(R.drawable.setting_preview_unlock);
multiactionButton.setOnLongClickListener(v -> {
if (imgView.getDrawable() == wall)
if (imgView.getDrawable() == prev)
imgView.setImageDrawable(wall1);
else if (imgView.getDrawable() == wall1)
imgView.setImageDrawable(realWall);
else
imgView.setImageDrawable(wall);
imgView.setImageDrawable(prev);

imgView.draw(canv);
controller.update();
controller.handleWallpaperImageChanged();
return true;
});

Expand All @@ -105,24 +113,31 @@ else if (imgView.getDrawable() == wall1)
unlock.setOnCheckedChangeListener((compoundButton, b) -> unlockBool = b);

Button effectSwitch = findViewById(R.id.effectsw);
effectSwitch.setText(R.string.unlock_effect_abstract);
effect = KeyguardEffectViewController.EFFECT_ABSTRACTTILE;
effectSwitch.setText(R.string.unlock_effect);
effectSwitch.setOnClickListener(view -> {
if (effect == KeyguardEffectViewController.EFFECT_ABSTRACTTILE) {
//findViewById(R.id.buttons).setAlpha(0.0f);
controller.playLockSound();
switchActivity(this);
/*if (effect == KeyguardEffectViewController.EFFECT_ABSTRACTTILE) {
effectSwitch.setText(R.string.unlock_effect_brilliant_ring);
effect = KeyguardEffectViewController.EFFECT_BRILLIANTRING;
} else if (effect == KeyguardEffectViewController.EFFECT_BRILLIANTRING) {
effectSwitch.setText(R.string.light_effect);
effect = KeyguardEffectViewController.EFFECT_LIGHT;
} else if (effect == KeyguardEffectViewController.EFFECT_LIGHT) {
effectSwitch.setText(R.string.blind_effect);
effect = KeyguardEffectViewController.EFFECT_BLIND;
} else {
effectSwitch.setText(R.string.unlock_effect_abstract);
effect = KeyguardEffectViewController.EFFECT_ABSTRACTTILE;
}
controller.handleWallpaperTypeChanged();
controller.show();
mUnlockView.showUnlockAffordance();
});
}*/

});
TextView clock = findViewById(R.id.clock);
FrameLayout.LayoutParams lp = (FrameLayout.LayoutParams) clock.getLayoutParams();
int fontSize = this.getResources().getDimensionPixelSize(R.dimen.kg_singleclock_time_text_size_normal);
lp.leftMargin = -((int) (fontSize / 15.0f));
clock.setLayoutParams(lp);
controller.setEffectLayout(mBackgroundRootLayout, mForegroundRootLayout, null);
/*mBackgroundRootLayout.addView(controller, -1, -1);
controller.update();
Expand All @@ -131,14 +146,10 @@ else if (imgView.getDrawable() == wall1)
view.addView(mUnlockView); */
}

@Override
public void onStart() {
super.onStart();
//controller.setEffectLayout(mBackgroundRootLayout, mBackgroundRootLayout, null);
//checkChild();

//findViewById(R.id.imageView).draw(canv);
//controller.show();
public static void switchActivity(Context context) {
Intent intent = new Intent(context, UnlockEffect.class);
intent.setFlags(FLAG_ACTIVITY_CLEAR_TOP | FLAG_ACTIVITY_SINGLE_TOP);
context.startActivity(intent);
}

@Override
Expand All @@ -150,7 +161,16 @@ protected void onPause() {
@Override
public void onResume() {
super.onResume();
controller.screenTurnedOn();
controller.show();
mUnlockView.showUnlockAffordance();
controller.playLockSound();
}

@Override
protected void onPostResume() {
super.onPostResume();
imgView.draw(canv);
controller.update();
}

}
19 changes: 19 additions & 0 deletions app/src/main/java/com/aj/effect/QuintEaseOut.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
package com.aj.effect;

import android.view.animation.BaseInterpolator;

public class QuintEaseOut extends BaseInterpolator {
public QuintEaseOut() {
}

@Override // android.animation.TimeInterpolator
public float getInterpolation(float t) {
return out(t);
}

private float out(float t) {
float t2 = t - 1.0f;
return (t2 * t2 * t2 * t2 * t2) + 1.0f;
}

}
Loading

0 comments on commit 9035eda

Please sign in to comment.