V1.0.4(5) Ad版本
18
.gitignore
vendored
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
*.iml
|
||||||
|
.gradle
|
||||||
|
/local.properties
|
||||||
|
#/.idea/caches
|
||||||
|
#/.idea/libraries
|
||||||
|
#/.idea/modules.xml
|
||||||
|
#/.idea/workspace.xml
|
||||||
|
#/.idea/navEditor.xml
|
||||||
|
#/.idea/assetWizardSettings.xml
|
||||||
|
.DS_Store
|
||||||
|
/build
|
||||||
|
/captures
|
||||||
|
.externalNativeBuild
|
||||||
|
.cxx
|
||||||
|
local.properties
|
||||||
|
.safedk
|
||||||
|
app/release
|
||||||
|
.idea
|
||||||
1
app/.gitignore
vendored
Normal file
@ -0,0 +1 @@
|
|||||||
|
/build
|
||||||
64
app/build.gradle.kts
Normal file
@ -0,0 +1,64 @@
|
|||||||
|
plugins {
|
||||||
|
id("com.android.application")
|
||||||
|
id("applovin-quality-service")
|
||||||
|
id("com.google.gms.google-services")
|
||||||
|
id("com.google.firebase.crashlytics")
|
||||||
|
}
|
||||||
|
applovin{
|
||||||
|
apiKey = "BAorLOnK5J2flG9XoJ_9GHUnqETtkiGRooRrcLMv6NTkcN1TGQblSvTkB4kdKPmVomCyvusXDiNfVk0_eegmSt"
|
||||||
|
}
|
||||||
|
android {
|
||||||
|
namespace = "emoticon.wasticker.app"
|
||||||
|
compileSdk = 34
|
||||||
|
|
||||||
|
defaultConfig {
|
||||||
|
applicationId = "emoticon.wasticker.app"
|
||||||
|
minSdk = 23
|
||||||
|
targetSdk = 34
|
||||||
|
versionCode = 5
|
||||||
|
versionName = "1.0.4"
|
||||||
|
|
||||||
|
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
|
||||||
|
}
|
||||||
|
|
||||||
|
buildTypes {
|
||||||
|
release {
|
||||||
|
isMinifyEnabled = true
|
||||||
|
proguardFiles(
|
||||||
|
getDefaultProguardFile("proguard-android-optimize.txt"),
|
||||||
|
"proguard-rules.pro"
|
||||||
|
)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
compileOptions {
|
||||||
|
sourceCompatibility = JavaVersion.VERSION_1_8
|
||||||
|
targetCompatibility = JavaVersion.VERSION_1_8
|
||||||
|
}
|
||||||
|
sourceSets {
|
||||||
|
getByName("main") {
|
||||||
|
assets {
|
||||||
|
srcDirs("src\\main\\assets", "src\\main\\assets")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
dependencies {
|
||||||
|
implementation("androidx.appcompat:appcompat:1.6.1")
|
||||||
|
implementation("com.google.android.material:material:1.11.0")
|
||||||
|
implementation("androidx.constraintlayout:constraintlayout:2.1.4")
|
||||||
|
testImplementation("junit:junit:4.13.2")
|
||||||
|
androidTestImplementation("androidx.test.ext:junit:1.1.5")
|
||||||
|
androidTestImplementation("androidx.test.espresso:espresso-core:3.5.1")
|
||||||
|
|
||||||
|
implementation ("com.google.code.gson:gson:2.10.1")
|
||||||
|
implementation ("com.github.bumptech.glide:glide:4.16.0")
|
||||||
|
|
||||||
|
implementation("com.applovin:applovin-sdk:+")
|
||||||
|
implementation("com.applovin.mediation:vungle-adapter:+")
|
||||||
|
implementation("com.applovin.mediation:bytedance-adapter:+")
|
||||||
|
implementation(platform("com.google.firebase:firebase-bom:32.3.1"))
|
||||||
|
implementation("com.google.firebase:firebase-analytics-ktx")
|
||||||
|
implementation ("com.google.firebase:firebase-crashlytics-ktx")
|
||||||
|
|
||||||
|
}
|
||||||
BIN
app/emoticonWasticker.jks
Normal file
29
app/google-services.json
Normal file
@ -0,0 +1,29 @@
|
|||||||
|
{
|
||||||
|
"project_info": {
|
||||||
|
"project_number": "584182945186",
|
||||||
|
"project_id": "emoticon-stickers",
|
||||||
|
"storage_bucket": "emoticon-stickers.appspot.com"
|
||||||
|
},
|
||||||
|
"client": [
|
||||||
|
{
|
||||||
|
"client_info": {
|
||||||
|
"mobilesdk_app_id": "1:584182945186:android:5014a63b7148356a2d0efb",
|
||||||
|
"android_client_info": {
|
||||||
|
"package_name": "emoticon.wasticker.app"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"oauth_client": [],
|
||||||
|
"api_key": [
|
||||||
|
{
|
||||||
|
"current_key": "AIzaSyDNdFQpDcAAo4iSbZyt7KPKTcd3YjC1SzA"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"services": {
|
||||||
|
"appinvite_service": {
|
||||||
|
"other_platform_oauth_client": []
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"configuration_version": "1"
|
||||||
|
}
|
||||||
28
app/proguard-rules.pro
vendored
Normal file
@ -0,0 +1,28 @@
|
|||||||
|
# Add project specific ProGuard rules here.
|
||||||
|
# You can control the set of applied configuration files using the
|
||||||
|
# proguardFiles setting in build.gradle.
|
||||||
|
#
|
||||||
|
# For more details, see
|
||||||
|
# http://developer.android.com/guide/developing/tools/proguard.html
|
||||||
|
|
||||||
|
# If your project uses WebView with JS, uncomment the following
|
||||||
|
# and specify the fully qualified class name to the JavaScript interface
|
||||||
|
# class:
|
||||||
|
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
|
||||||
|
# public *;
|
||||||
|
#}
|
||||||
|
|
||||||
|
# Uncomment this to preserve the line number information for
|
||||||
|
# debugging stack traces.
|
||||||
|
#-keepattributes SourceFile,LineNumberTable
|
||||||
|
|
||||||
|
# If you keep the line number information, uncomment this to
|
||||||
|
# hide the original source file name.
|
||||||
|
#-renamesourcefileattribute SourceFile
|
||||||
|
|
||||||
|
-keep class emoticon.wasticker.app.data.** { *; }
|
||||||
|
-keep class com.google.gson.** { *; }
|
||||||
|
-keepattributes Signature
|
||||||
|
-keep class com.google.gson.reflect.TypeToken { *; }
|
||||||
|
-keep class * extends com.google.gson.reflect.TypeToken
|
||||||
|
-keepattributes AnnotationDefault,RuntimeVisibleAnnotations
|
||||||
@ -0,0 +1,26 @@
|
|||||||
|
package emoticon.wasticker.app;
|
||||||
|
|
||||||
|
import android.content.Context;
|
||||||
|
|
||||||
|
import androidx.test.platform.app.InstrumentationRegistry;
|
||||||
|
import androidx.test.ext.junit.runners.AndroidJUnit4;
|
||||||
|
|
||||||
|
import org.junit.Test;
|
||||||
|
import org.junit.runner.RunWith;
|
||||||
|
|
||||||
|
import static org.junit.Assert.*;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Instrumented test, which will execute on an Android device.
|
||||||
|
*
|
||||||
|
* @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
|
||||||
|
*/
|
||||||
|
@RunWith(AndroidJUnit4.class)
|
||||||
|
public class ExampleInstrumentedTest {
|
||||||
|
@Test
|
||||||
|
public void useAppContext() {
|
||||||
|
// Context of the app under test.
|
||||||
|
Context appContext = InstrumentationRegistry.getInstrumentation().getTargetContext();
|
||||||
|
assertEquals("sticker.test.stickerapplication", appContext.getPackageName());
|
||||||
|
}
|
||||||
|
}
|
||||||
46
app/src/main/AndroidManifest.xml
Normal file
@ -0,0 +1,46 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
xmlns:tools="http://schemas.android.com/tools">
|
||||||
|
|
||||||
|
<uses-permission android:name="android.permission.INTERNET" />
|
||||||
|
|
||||||
|
<application
|
||||||
|
android:name="emoticon.wasticker.app.App"
|
||||||
|
android:allowBackup="true"
|
||||||
|
android:dataExtractionRules="@xml/data_extraction_rules"
|
||||||
|
android:fullBackupContent="@xml/backup_rules"
|
||||||
|
android:icon="@mipmap/sticker_logo"
|
||||||
|
android:label="@string/app_name"
|
||||||
|
android:roundIcon="@mipmap/sticker_logo"
|
||||||
|
android:supportsRtl="true"
|
||||||
|
android:theme="@style/Theme.StickerApplication"
|
||||||
|
tools:targetApi="31">
|
||||||
|
<activity
|
||||||
|
android:name="emoticon.wasticker.app.view.FirstOpenActivity"
|
||||||
|
android:exported="true">
|
||||||
|
<intent-filter>
|
||||||
|
<action android:name="android.intent.action.MAIN" />
|
||||||
|
|
||||||
|
<category android:name="android.intent.category.LAUNCHER" />
|
||||||
|
</intent-filter>
|
||||||
|
</activity>
|
||||||
|
<activity
|
||||||
|
android:name="emoticon.wasticker.app.view.AddActivity"
|
||||||
|
android:exported="false" />
|
||||||
|
<activity
|
||||||
|
android:name="emoticon.wasticker.app.view.MainActivity"
|
||||||
|
android:launchMode="singleTask"
|
||||||
|
android:exported="false"/>
|
||||||
|
|
||||||
|
<provider
|
||||||
|
android:name="emoticon.wasticker.app.provider.MyProvider"
|
||||||
|
android:authorities="emoticon.wasticker.app.provider.StickerProvider"
|
||||||
|
android:enabled="true"
|
||||||
|
android:exported="true"
|
||||||
|
android:readPermission="com.whatsapp.sticker.READ" />
|
||||||
|
<meta-data
|
||||||
|
android:name="applovin.sdk.key"
|
||||||
|
android:value="sDLlO092_Cbep8k6m8cMwThT8Li5FLhpzMzTTwT_MPQrunXD17wVx8_cDJnmwDocdO4pTu5se8qvPDRNHvLKb8"/>
|
||||||
|
</application>
|
||||||
|
|
||||||
|
</manifest>
|
||||||
3032
app/src/main/assets/data.json
Normal file
56
app/src/main/java/emoticon/wasticker/app/App.java
Normal file
@ -0,0 +1,56 @@
|
|||||||
|
package emoticon.wasticker.app;
|
||||||
|
|
||||||
|
import android.app.Application;
|
||||||
|
import android.util.Log;
|
||||||
|
|
||||||
|
import com.applovin.sdk.AppLovinSdk;
|
||||||
|
import com.applovin.sdk.AppLovinSdkConfiguration;
|
||||||
|
import com.google.gson.Gson;
|
||||||
|
import com.google.gson.reflect.TypeToken;
|
||||||
|
|
||||||
|
import java.io.IOException;
|
||||||
|
import java.io.InputStream;
|
||||||
|
import java.util.Collections;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import emoticon.wasticker.app.data.Data;
|
||||||
|
import emoticon.wasticker.app.manager.AdLoad;
|
||||||
|
import emoticon.wasticker.app.manager.SPManager;
|
||||||
|
import emoticon.wasticker.app.manager.Unit;
|
||||||
|
|
||||||
|
public class App extends Application {
|
||||||
|
|
||||||
|
|
||||||
|
private static List<Data> data;
|
||||||
|
|
||||||
|
private static App app;
|
||||||
|
|
||||||
|
public static List<Data> getData() {
|
||||||
|
return data;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static App getApp() {
|
||||||
|
return app;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onCreate() {
|
||||||
|
super.onCreate();
|
||||||
|
app = this;
|
||||||
|
SPManager.init(this);
|
||||||
|
|
||||||
|
try {
|
||||||
|
InputStream open = getAssets().open("data.json");
|
||||||
|
String s = Unit.fileToString(open);
|
||||||
|
Gson gson = new Gson();
|
||||||
|
TypeToken<List<Data>> typeToken = new TypeToken<List<Data>>() {};
|
||||||
|
List<Data> tempData = gson.fromJson(s, typeToken.getType());
|
||||||
|
Collections.shuffle(tempData);
|
||||||
|
data = tempData;
|
||||||
|
|
||||||
|
} catch (IOException e) {
|
||||||
|
throw new RuntimeException(e);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
28
app/src/main/java/emoticon/wasticker/app/data/Data.java
Normal file
@ -0,0 +1,28 @@
|
|||||||
|
package emoticon.wasticker.app.data;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
public class Data implements Serializable {
|
||||||
|
|
||||||
|
private String categoryName;
|
||||||
|
|
||||||
|
|
||||||
|
private List<DataChildnew> childList;
|
||||||
|
|
||||||
|
public void setCategoryName(String categoryName) {
|
||||||
|
this.categoryName = categoryName;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setChildList(List<DataChildnew> childList) {
|
||||||
|
this.childList = childList;
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<DataChildnew> getChildList() {
|
||||||
|
return childList;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getCategoryName() {
|
||||||
|
return categoryName;
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,59 @@
|
|||||||
|
package emoticon.wasticker.app.data;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
public class DataChildnew implements Serializable {
|
||||||
|
|
||||||
|
private String identifierName;
|
||||||
|
|
||||||
|
private String title;
|
||||||
|
|
||||||
|
private String zipUrl;
|
||||||
|
|
||||||
|
private int count;
|
||||||
|
|
||||||
|
|
||||||
|
private List<String> previewList ;
|
||||||
|
|
||||||
|
public void setIdentifierName(String identifierName) {
|
||||||
|
this.identifierName = identifierName;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setPreviewList(List<String> previewList) {
|
||||||
|
this.previewList = previewList;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setTitle(String title) {
|
||||||
|
this.title = title;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCount(int count) {
|
||||||
|
this.count = count;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setZipUrl(String zipUrl) {
|
||||||
|
this.zipUrl = zipUrl;
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<String> getPreviewList() {
|
||||||
|
return previewList;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getIdentifierName() {
|
||||||
|
return identifierName;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getTitle() {
|
||||||
|
return title;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getZipUrl() {
|
||||||
|
return zipUrl;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getCount() {
|
||||||
|
return count;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@ -0,0 +1,30 @@
|
|||||||
|
package emoticon.wasticker.app.data.pack;
|
||||||
|
|
||||||
|
import com.google.gson.annotations.SerializedName;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
public class ContentJson {
|
||||||
|
|
||||||
|
@SerializedName("android_play_store_link")
|
||||||
|
private String storeLink;
|
||||||
|
|
||||||
|
@SerializedName("ios_app_store_link")
|
||||||
|
private String iosLink;
|
||||||
|
|
||||||
|
@SerializedName("sticker_packs")
|
||||||
|
private List<Pack> packs;
|
||||||
|
|
||||||
|
|
||||||
|
public List<Pack> getPacks() {
|
||||||
|
return packs;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getIosLink() {
|
||||||
|
return iosLink;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getStoreLink() {
|
||||||
|
return storeLink;
|
||||||
|
}
|
||||||
|
}
|
||||||
93
app/src/main/java/emoticon/wasticker/app/data/pack/Pack.java
Normal file
@ -0,0 +1,93 @@
|
|||||||
|
package emoticon.wasticker.app.data.pack;
|
||||||
|
|
||||||
|
import com.google.gson.annotations.SerializedName;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
public class Pack {
|
||||||
|
|
||||||
|
|
||||||
|
@SerializedName("identifier")
|
||||||
|
private String identifier;
|
||||||
|
|
||||||
|
@SerializedName("name")
|
||||||
|
private String name;
|
||||||
|
|
||||||
|
@SerializedName("tray_image_file")
|
||||||
|
private String trayName;
|
||||||
|
|
||||||
|
@SerializedName("publisher")
|
||||||
|
private String publisher;
|
||||||
|
|
||||||
|
|
||||||
|
@SerializedName("publisher_full")
|
||||||
|
private String publisherFull;
|
||||||
|
|
||||||
|
|
||||||
|
@SerializedName("publisher_email")
|
||||||
|
private String email;
|
||||||
|
|
||||||
|
@SerializedName("publisher_website")
|
||||||
|
private String websitePublisher;
|
||||||
|
|
||||||
|
@SerializedName("privacy_policy_website")
|
||||||
|
private String websitePrivacy;
|
||||||
|
|
||||||
|
@SerializedName("license_agreement_website")
|
||||||
|
private String websiteLicense;
|
||||||
|
|
||||||
|
@SerializedName("share_url")
|
||||||
|
private String shareUrl;
|
||||||
|
|
||||||
|
@SerializedName("is_premium")
|
||||||
|
private boolean isPremium;
|
||||||
|
|
||||||
|
@SerializedName("animated_sticker_pack")
|
||||||
|
private boolean animated;
|
||||||
|
@SerializedName("stickers")
|
||||||
|
private List<PackImg> stickers;
|
||||||
|
|
||||||
|
public List<PackImg> getStickers() {
|
||||||
|
return stickers;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getEmail() {
|
||||||
|
return email;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getTrayName() {
|
||||||
|
return trayName;
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean isAnimated() {
|
||||||
|
return animated;
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean isPremium() {
|
||||||
|
return isPremium;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getIdentifier() {
|
||||||
|
return identifier;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getName() {
|
||||||
|
return name;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getPublisherFull() {
|
||||||
|
return publisherFull;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getWebsitePublisher() {
|
||||||
|
return websitePublisher;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getWebsiteLicense() {
|
||||||
|
return websiteLicense;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getWebsitePrivacy() {
|
||||||
|
return websitePrivacy;
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,24 @@
|
|||||||
|
package emoticon.wasticker.app.data.pack;
|
||||||
|
|
||||||
|
import com.google.gson.annotations.SerializedName;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
public class PackImg {
|
||||||
|
|
||||||
|
|
||||||
|
@SerializedName("image_file")
|
||||||
|
private String imFileName;
|
||||||
|
|
||||||
|
@SerializedName("emojis")
|
||||||
|
private List<String> emojis;
|
||||||
|
|
||||||
|
|
||||||
|
public String getImFileName() {
|
||||||
|
return imFileName;
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<String> getEmojis() {
|
||||||
|
return emojis;
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,81 @@
|
|||||||
|
package emoticon.wasticker.app.initadapter.home;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
import android.content.Context;
|
||||||
|
import android.view.LayoutInflater;
|
||||||
|
import android.view.View;
|
||||||
|
import android.view.ViewGroup;
|
||||||
|
|
||||||
|
import androidx.annotation.NonNull;
|
||||||
|
import androidx.recyclerview.widget.GridLayoutManager;
|
||||||
|
import androidx.recyclerview.widget.RecyclerView;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import emoticon.wasticker.app.initadapter.homechild.HomeChildAdapter;
|
||||||
|
import emoticon.wasticker.app.R;
|
||||||
|
import emoticon.wasticker.app.data.DataChildnew;
|
||||||
|
import emoticon.wasticker.app.listener.HomeChildClickListener;
|
||||||
|
import emoticon.wasticker.app.listener.HomeClickListener;
|
||||||
|
|
||||||
|
public class HomeAdapter extends RecyclerView.Adapter<HomeViewHolder> {
|
||||||
|
private List<DataChildnew> dataChildList;
|
||||||
|
private Context mContext;
|
||||||
|
|
||||||
|
public HomeAdapter(List<DataChildnew> childData, Context context) {
|
||||||
|
this.dataChildList = childData;
|
||||||
|
this.mContext = context;
|
||||||
|
}
|
||||||
|
|
||||||
|
private HomeClickListener listener;
|
||||||
|
|
||||||
|
|
||||||
|
public void setListener(HomeClickListener listener) {
|
||||||
|
this.listener = listener;
|
||||||
|
}
|
||||||
|
|
||||||
|
@NonNull
|
||||||
|
@Override
|
||||||
|
public HomeViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
|
||||||
|
View view = LayoutInflater.from(mContext).inflate(R.layout.adapter_home, parent, false);
|
||||||
|
return new HomeViewHolder(view);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onBindViewHolder(@NonNull HomeViewHolder holder, int position) {
|
||||||
|
DataChildnew dataChildnew = dataChildList.get(position);
|
||||||
|
|
||||||
|
holder.getTextViewName().setText(dataChildnew.getTitle());
|
||||||
|
RecyclerView recyclerView = holder.getRecyclerView();
|
||||||
|
recyclerView.setLayoutManager(new GridLayoutManager(mContext, 5));
|
||||||
|
HomeChildAdapter homeChildAdapter = new HomeChildAdapter(dataChildnew.getPreviewList(), mContext, dataChildnew.getCount());
|
||||||
|
homeChildAdapter.setListener(new HomeChildClickListener() {
|
||||||
|
@Override
|
||||||
|
public void onHomeChildClickListener() {
|
||||||
|
if (listener != null) {
|
||||||
|
listener.onHomeClickListener(dataChildnew);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
});
|
||||||
|
recyclerView.setAdapter(homeChildAdapter);
|
||||||
|
holder.getItemCardView().setOnClickListener(new View.OnClickListener() {
|
||||||
|
@Override
|
||||||
|
public void onClick(View v) {
|
||||||
|
if (listener != null) {
|
||||||
|
listener.onHomeClickListener(dataChildnew);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int getItemCount() {
|
||||||
|
return dataChildList.size();
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,40 @@
|
|||||||
|
package emoticon.wasticker.app.initadapter.home;
|
||||||
|
|
||||||
|
import android.view.View;
|
||||||
|
import android.widget.TextView;
|
||||||
|
|
||||||
|
import androidx.annotation.NonNull;
|
||||||
|
import androidx.cardview.widget.CardView;
|
||||||
|
import androidx.recyclerview.widget.RecyclerView;
|
||||||
|
|
||||||
|
import emoticon.wasticker.app.R;
|
||||||
|
|
||||||
|
|
||||||
|
public class HomeViewHolder extends RecyclerView.ViewHolder {
|
||||||
|
|
||||||
|
private RecyclerView recyclerView;
|
||||||
|
|
||||||
|
private TextView textViewName;
|
||||||
|
|
||||||
|
private CardView itemCardView;
|
||||||
|
public HomeViewHolder(@NonNull View itemView) {
|
||||||
|
super(itemView);
|
||||||
|
|
||||||
|
recyclerView = itemView.findViewById(R.id.recycler_preview);
|
||||||
|
textViewName = itemView.findViewById(R.id.name_tv);
|
||||||
|
itemCardView = itemView.findViewById(R.id.item_card_view);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public CardView getItemCardView() {
|
||||||
|
return itemCardView;
|
||||||
|
}
|
||||||
|
|
||||||
|
public RecyclerView getRecyclerView() {
|
||||||
|
return recyclerView;
|
||||||
|
}
|
||||||
|
|
||||||
|
public TextView getTextViewName() {
|
||||||
|
return textViewName;
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,77 @@
|
|||||||
|
package emoticon.wasticker.app.initadapter.homechild;
|
||||||
|
|
||||||
|
import android.content.Context;
|
||||||
|
import android.view.LayoutInflater;
|
||||||
|
import android.view.View;
|
||||||
|
import android.view.ViewGroup;
|
||||||
|
import android.widget.TextView;
|
||||||
|
|
||||||
|
import androidx.annotation.NonNull;
|
||||||
|
import androidx.recyclerview.widget.RecyclerView;
|
||||||
|
|
||||||
|
import com.bumptech.glide.Glide;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
|
||||||
|
import emoticon.wasticker.app.R;
|
||||||
|
import emoticon.wasticker.app.listener.HomeChildClickListener;
|
||||||
|
|
||||||
|
public class HomeChildAdapter extends RecyclerView.Adapter<HomeChildViewHolder> {
|
||||||
|
|
||||||
|
|
||||||
|
private List<String> list;
|
||||||
|
private Context mContext;
|
||||||
|
|
||||||
|
private int mCount;
|
||||||
|
private HomeChildClickListener listener;
|
||||||
|
public HomeChildAdapter(List<String> childData, Context context, int count) {
|
||||||
|
this.list = childData;
|
||||||
|
this.mContext = context;
|
||||||
|
this.mCount = count;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public void setListener(HomeChildClickListener listener) {
|
||||||
|
this.listener = listener;
|
||||||
|
}
|
||||||
|
|
||||||
|
@NonNull
|
||||||
|
@Override
|
||||||
|
public HomeChildViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
|
||||||
|
View view = LayoutInflater.from(mContext).inflate(R.layout.adapter_home_child, parent, false);
|
||||||
|
return new HomeChildViewHolder(view);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onBindViewHolder(@NonNull HomeChildViewHolder holder, int position) {
|
||||||
|
String preview = list.get(position);
|
||||||
|
|
||||||
|
Glide.with(mContext).load(preview).into(holder.getImageView());
|
||||||
|
holder.getRelativeLayout().setOnClickListener(new View.OnClickListener() {
|
||||||
|
@Override
|
||||||
|
public void onClick(View v) {
|
||||||
|
if(listener != null){
|
||||||
|
listener.onHomeChildClickListener();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
});
|
||||||
|
if (position == list.size() - 1) {
|
||||||
|
TextView countTV = holder.getCountTV();
|
||||||
|
countTV.setVisibility(View.VISIBLE);
|
||||||
|
countTV.setText("+" + mCount);
|
||||||
|
|
||||||
|
|
||||||
|
} else {
|
||||||
|
holder.getCountTV().setVisibility(View.GONE);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int getItemCount() {
|
||||||
|
return list.size();
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,42 @@
|
|||||||
|
package emoticon.wasticker.app.initadapter.homechild;
|
||||||
|
|
||||||
|
import android.view.View;
|
||||||
|
import android.widget.ImageView;
|
||||||
|
import android.widget.RelativeLayout;
|
||||||
|
import android.widget.TextView;
|
||||||
|
|
||||||
|
import androidx.annotation.NonNull;
|
||||||
|
import androidx.recyclerview.widget.RecyclerView;
|
||||||
|
|
||||||
|
import emoticon.wasticker.app.R;
|
||||||
|
|
||||||
|
|
||||||
|
public class HomeChildViewHolder extends RecyclerView.ViewHolder {
|
||||||
|
|
||||||
|
private ImageView imageView;
|
||||||
|
private TextView countTV;
|
||||||
|
|
||||||
|
private RelativeLayout relativeLayout;
|
||||||
|
|
||||||
|
|
||||||
|
public HomeChildViewHolder(@NonNull View itemView) {
|
||||||
|
super(itemView);
|
||||||
|
|
||||||
|
imageView = itemView.findViewById(R.id.preview_im);
|
||||||
|
countTV = itemView.findViewById(R.id.preview_count_tv);
|
||||||
|
relativeLayout = itemView.findViewById(R.id.relayout);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public RelativeLayout getRelativeLayout() {
|
||||||
|
return relativeLayout;
|
||||||
|
}
|
||||||
|
|
||||||
|
public ImageView getImageView() {
|
||||||
|
return imageView;
|
||||||
|
}
|
||||||
|
|
||||||
|
public TextView getCountTV() {
|
||||||
|
return countTV;
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,60 @@
|
|||||||
|
package emoticon.wasticker.app.initadapter.sticker;
|
||||||
|
|
||||||
|
import android.content.Context;
|
||||||
|
import android.view.LayoutInflater;
|
||||||
|
import android.view.View;
|
||||||
|
import android.view.ViewGroup;
|
||||||
|
|
||||||
|
import androidx.annotation.NonNull;
|
||||||
|
import androidx.recyclerview.widget.RecyclerView;
|
||||||
|
|
||||||
|
import com.bumptech.glide.Glide;
|
||||||
|
|
||||||
|
import java.io.File;
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import emoticon.wasticker.app.R;
|
||||||
|
|
||||||
|
|
||||||
|
public class StickerAdapter extends RecyclerView.Adapter<StickerViewHolder> {
|
||||||
|
|
||||||
|
|
||||||
|
private List<File> list = new ArrayList<>();
|
||||||
|
private Context mContext;
|
||||||
|
|
||||||
|
public StickerAdapter(Context context) {
|
||||||
|
|
||||||
|
this.mContext = context;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setList(List<File> list) {
|
||||||
|
this.list = list;
|
||||||
|
notifyDataSetChanged();
|
||||||
|
}
|
||||||
|
|
||||||
|
@NonNull
|
||||||
|
@Override
|
||||||
|
public StickerViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
|
||||||
|
View view = LayoutInflater.from(mContext).inflate(R.layout.adapter_sticker, parent, false);
|
||||||
|
return new StickerViewHolder(view);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onBindViewHolder(@NonNull StickerViewHolder holder, int position) {
|
||||||
|
File previewFile = list.get(position);
|
||||||
|
Glide.with(mContext).load(previewFile).into(holder.getImageView());
|
||||||
|
holder.getPosTv().setText(String.valueOf(position + 1));
|
||||||
|
if (position == list.size() - 1) {
|
||||||
|
holder.getSpaceView().setVisibility(View.VISIBLE);
|
||||||
|
} else {
|
||||||
|
holder.getSpaceView().setVisibility(View.GONE);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int getItemCount() {
|
||||||
|
return list.size();
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,42 @@
|
|||||||
|
package emoticon.wasticker.app.initadapter.sticker;
|
||||||
|
|
||||||
|
import android.view.View;
|
||||||
|
import android.widget.ImageView;
|
||||||
|
import android.widget.TextView;
|
||||||
|
|
||||||
|
import androidx.annotation.NonNull;
|
||||||
|
import androidx.recyclerview.widget.RecyclerView;
|
||||||
|
|
||||||
|
import emoticon.wasticker.app.R;
|
||||||
|
|
||||||
|
|
||||||
|
public class StickerViewHolder extends RecyclerView.ViewHolder {
|
||||||
|
|
||||||
|
private ImageView imageView;
|
||||||
|
private TextView posTv;
|
||||||
|
|
||||||
|
private View spaceView;
|
||||||
|
|
||||||
|
|
||||||
|
public StickerViewHolder(@NonNull View itemView) {
|
||||||
|
super(itemView);
|
||||||
|
|
||||||
|
imageView = itemView.findViewById(R.id.sticker_im);
|
||||||
|
posTv = itemView.findViewById(R.id.sticker_pos_tv);
|
||||||
|
spaceView = itemView.findViewById(R.id.spaceView);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public View getSpaceView() {
|
||||||
|
return spaceView;
|
||||||
|
}
|
||||||
|
|
||||||
|
public ImageView getImageView() {
|
||||||
|
return imageView;
|
||||||
|
}
|
||||||
|
|
||||||
|
public TextView getPosTv() {
|
||||||
|
return posTv;
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,14 @@
|
|||||||
|
package emoticon.wasticker.app.listener;
|
||||||
|
|
||||||
|
import com.applovin.mediation.MaxAd;
|
||||||
|
import com.applovin.mediation.MaxError;
|
||||||
|
import com.applovin.mediation.ads.MaxInterstitialAd;
|
||||||
|
|
||||||
|
public interface AdListener {
|
||||||
|
void onShowFail(MaxAd ad);
|
||||||
|
void onShowSuccess(MaxAd ad);
|
||||||
|
void onHidden( );
|
||||||
|
|
||||||
|
void onLoadFail(String string, MaxError maxError);
|
||||||
|
void onLoadSuccess(MaxAd ad);
|
||||||
|
}
|
||||||
@ -0,0 +1,6 @@
|
|||||||
|
package emoticon.wasticker.app.listener;
|
||||||
|
|
||||||
|
public interface DownloadListener {
|
||||||
|
|
||||||
|
abstract void downloadListener(Boolean isDownloadSuccess,Boolean isUnzipSuccess,String newPath);
|
||||||
|
}
|
||||||
@ -0,0 +1,6 @@
|
|||||||
|
package emoticon.wasticker.app.listener;
|
||||||
|
|
||||||
|
public interface HomeChildClickListener {
|
||||||
|
|
||||||
|
abstract void onHomeChildClickListener();
|
||||||
|
}
|
||||||
@ -0,0 +1,8 @@
|
|||||||
|
package emoticon.wasticker.app.listener;
|
||||||
|
|
||||||
|
import emoticon.wasticker.app.data.DataChildnew;
|
||||||
|
|
||||||
|
public interface HomeClickListener {
|
||||||
|
|
||||||
|
abstract void onHomeClickListener(DataChildnew dataChildnew);
|
||||||
|
}
|
||||||
@ -0,0 +1,5 @@
|
|||||||
|
package emoticon.wasticker.app.listener;
|
||||||
|
|
||||||
|
public interface initSDkListener {
|
||||||
|
void onComplete();
|
||||||
|
}
|
||||||
130
app/src/main/java/emoticon/wasticker/app/manager/AdLoad.java
Normal file
@ -0,0 +1,130 @@
|
|||||||
|
package emoticon.wasticker.app.manager;
|
||||||
|
|
||||||
|
import android.app.Activity;
|
||||||
|
|
||||||
|
import androidx.annotation.NonNull;
|
||||||
|
|
||||||
|
import com.applovin.mediation.MaxAd;
|
||||||
|
import com.applovin.mediation.MaxAdListener;
|
||||||
|
import com.applovin.mediation.MaxError;
|
||||||
|
import com.applovin.mediation.ads.MaxInterstitialAd;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.Collections;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import emoticon.wasticker.app.listener.AdListener;
|
||||||
|
|
||||||
|
public class AdLoad {
|
||||||
|
|
||||||
|
public static final String ad_1 = "1ef06eb9fcfdf647";
|
||||||
|
public static final String ad_2 = "0ab3b7bfcd6f2965";
|
||||||
|
public static final String ad_3 = "353729c133f3fbff";
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
public static MaxInterstitialAd showMyAd(List<MaxInterstitialAd> ads)
|
||||||
|
{
|
||||||
|
Collections.shuffle(ads);
|
||||||
|
for(int g=0;g<ads.size()-1;g++){
|
||||||
|
MaxInterstitialAd maxInterstitialAd = ads.get(g);
|
||||||
|
if(maxInterstitialAd.isReady()){
|
||||||
|
return maxInterstitialAd;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void setAdShowListener(MaxInterstitialAd ad, AdListener adListener){
|
||||||
|
ad.setListener(new MaxAdListener() {
|
||||||
|
@Override
|
||||||
|
public void onAdLoaded(@NonNull MaxAd maxAd) {
|
||||||
|
if(adListener != null){
|
||||||
|
adListener.onLoadSuccess(maxAd);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onAdDisplayed(@NonNull MaxAd maxAd) {
|
||||||
|
|
||||||
|
if(adListener != null){
|
||||||
|
adListener.onShowSuccess(maxAd);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onAdHidden(@NonNull MaxAd maxAd) {
|
||||||
|
if(adListener != null){
|
||||||
|
adListener.onHidden();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onAdClicked(@NonNull MaxAd maxAd) {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onAdLoadFailed(@NonNull String s, @NonNull MaxError maxError) {
|
||||||
|
if(adListener != null){
|
||||||
|
adListener.onLoadFail(s,maxError);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onAdDisplayFailed(@NonNull MaxAd maxAd, @NonNull MaxError maxError) {
|
||||||
|
if(adListener != null){
|
||||||
|
adListener.onShowFail(maxAd);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public static List<MaxInterstitialAd> createAd(Activity mActivity) {
|
||||||
|
MaxInterstitialAd ad1 = new MaxInterstitialAd(ad_1, mActivity);
|
||||||
|
MaxInterstitialAd ad2 = new MaxInterstitialAd(ad_2, mActivity);
|
||||||
|
MaxInterstitialAd ad3 = new MaxInterstitialAd(ad_3, mActivity);
|
||||||
|
ArrayList<MaxInterstitialAd> ads = new ArrayList<>();
|
||||||
|
ads.add(ad1);
|
||||||
|
ads.add(ad2);
|
||||||
|
ads.add(ad3);
|
||||||
|
return ads;
|
||||||
|
}
|
||||||
|
|
||||||
|
private void setAdLoadListener(MaxInterstitialAd ad){
|
||||||
|
ad.setListener(new MaxAdListener() {
|
||||||
|
@Override
|
||||||
|
public void onAdLoaded(@NonNull MaxAd maxAd) {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onAdDisplayed(@NonNull MaxAd maxAd) {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onAdHidden(@NonNull MaxAd maxAd) {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onAdClicked(@NonNull MaxAd maxAd) {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onAdLoadFailed(@NonNull String s, @NonNull MaxError maxError) {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onAdDisplayFailed(@NonNull MaxAd maxAd, @NonNull MaxError maxError) {
|
||||||
|
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,79 @@
|
|||||||
|
package emoticon.wasticker.app.manager;
|
||||||
|
|
||||||
|
import android.content.Context;
|
||||||
|
|
||||||
|
import androidx.annotation.NonNull;
|
||||||
|
import androidx.annotation.Nullable;
|
||||||
|
|
||||||
|
import com.bumptech.glide.Glide;
|
||||||
|
import com.bumptech.glide.load.DataSource;
|
||||||
|
import com.bumptech.glide.load.engine.GlideException;
|
||||||
|
import com.bumptech.glide.request.RequestListener;
|
||||||
|
import com.bumptech.glide.request.target.Target;
|
||||||
|
|
||||||
|
import java.io.File;
|
||||||
|
import java.io.FileOutputStream;
|
||||||
|
import java.io.InputStream;
|
||||||
|
import java.util.Enumeration;
|
||||||
|
import java.util.zip.ZipEntry;
|
||||||
|
import java.util.zip.ZipFile;
|
||||||
|
|
||||||
|
import emoticon.wasticker.app.listener.DownloadListener;
|
||||||
|
|
||||||
|
public abstract class Download {
|
||||||
|
|
||||||
|
public static void startDownloadFile(Context context, String zipUrl, String newPath, DownloadListener listener) {
|
||||||
|
Glide.with(context).downloadOnly().load(zipUrl).addListener(new RequestListener<File>() {
|
||||||
|
@Override
|
||||||
|
public boolean onLoadFailed(@Nullable GlideException e, @Nullable Object model, @NonNull Target<File> target, boolean isFirstResource) {
|
||||||
|
listener.downloadListener(false,false, newPath);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean onResourceReady(@NonNull File resource, @NonNull Object model, Target<File> target, @NonNull DataSource dataSource, boolean isFirstResource) {
|
||||||
|
Boolean aBoolean = startUnzipFile(resource, newPath);
|
||||||
|
listener.downloadListener(true,aBoolean, newPath);
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}).preload();
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
private static Boolean startUnzipFile(File oldFile, String newPath) {
|
||||||
|
try {
|
||||||
|
File newFile = new File(newPath);
|
||||||
|
if(!newFile.exists()){
|
||||||
|
newFile.mkdir();
|
||||||
|
}
|
||||||
|
|
||||||
|
String absolutePath = oldFile.getAbsolutePath();
|
||||||
|
ZipFile zipFile = new ZipFile(absolutePath);
|
||||||
|
Enumeration<? extends ZipEntry> entries = zipFile.entries();
|
||||||
|
while (entries.hasMoreElements()) {
|
||||||
|
ZipEntry entry = entries.nextElement();
|
||||||
|
File file = new File(newPath, entry.getName());
|
||||||
|
if (entry.isDirectory()) {
|
||||||
|
file.mkdirs();
|
||||||
|
} else {
|
||||||
|
FileOutputStream outputStream = new FileOutputStream(file);
|
||||||
|
InputStream inputStream = zipFile.getInputStream(entry);
|
||||||
|
byte[] bytes = new byte[1024];
|
||||||
|
int length = 0;
|
||||||
|
while ((length = inputStream.read(bytes)) > 0) {
|
||||||
|
outputStream.write(bytes, 0, length);
|
||||||
|
}
|
||||||
|
outputStream.close();
|
||||||
|
inputStream.close();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
return true;
|
||||||
|
} catch (Exception exception) {
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,100 @@
|
|||||||
|
package emoticon.wasticker.app.manager;
|
||||||
|
|
||||||
|
import android.database.MatrixCursor;
|
||||||
|
import android.text.TextUtils;
|
||||||
|
|
||||||
|
import com.google.gson.Gson;
|
||||||
|
import com.google.gson.reflect.TypeToken;
|
||||||
|
|
||||||
|
import java.io.File;
|
||||||
|
import java.io.FileInputStream;
|
||||||
|
import java.io.FileNotFoundException;
|
||||||
|
|
||||||
|
import emoticon.wasticker.app.data.pack.ContentJson;
|
||||||
|
import emoticon.wasticker.app.data.pack.Pack;
|
||||||
|
import emoticon.wasticker.app.data.pack.PackImg;
|
||||||
|
|
||||||
|
public class ProviderManager {
|
||||||
|
|
||||||
|
public static ContentJson getPack(String identifier) {
|
||||||
|
|
||||||
|
String filePath = SPManager.queryJsonFile(identifier);
|
||||||
|
|
||||||
|
File file = new File(filePath);
|
||||||
|
if (file.exists()) {
|
||||||
|
try {
|
||||||
|
FileInputStream fileInputStream = new FileInputStream(file);
|
||||||
|
String s = Unit.fileToString(fileInputStream);
|
||||||
|
Gson gson = new Gson();
|
||||||
|
TypeToken<ContentJson> typeToken = new TypeToken<ContentJson>() {
|
||||||
|
};
|
||||||
|
ContentJson contentJson = gson.fromJson(s, typeToken.getType());
|
||||||
|
|
||||||
|
return contentJson;
|
||||||
|
} catch (FileNotFoundException exception) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public static String getFileDir(String identifier) {
|
||||||
|
String filePath = SPManager.queryJsonFile(identifier);
|
||||||
|
String substring = filePath.substring(0, filePath.lastIndexOf("contents.json"));
|
||||||
|
|
||||||
|
return substring;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public static MatrixCursor getCursorThree(ContentJson contentJson) {
|
||||||
|
String[] a = {Values.STICKER_FILE_NAME, Values.STICKER_EMOJI};
|
||||||
|
MatrixCursor matrixCursor = new MatrixCursor(a);
|
||||||
|
for (PackImg sticker : contentJson.getPacks().get(0).getStickers()) {
|
||||||
|
String[] values = {sticker.getImFileName(), TextUtils.join(",", sticker.getEmojis())};
|
||||||
|
matrixCursor.addRow(values);
|
||||||
|
}
|
||||||
|
return matrixCursor;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public static MatrixCursor getCursorTwo(ContentJson contentJson) {
|
||||||
|
String[] a = {
|
||||||
|
Values.ANDROID_LINK,
|
||||||
|
Values.IOS_LINK,
|
||||||
|
Values.STICKER_TRAY,
|
||||||
|
Values.STICKER_IDENTIFIER,
|
||||||
|
Values.STICKER_NAME,
|
||||||
|
Values.STICKER_PUBLISHER,
|
||||||
|
Values.EMAIL,
|
||||||
|
Values.WEBSITE_PUBLISH,
|
||||||
|
Values.WEBSITE_LICENSE,
|
||||||
|
Values.WEBSITE_POLICY,
|
||||||
|
Values.ANIMATED};
|
||||||
|
MatrixCursor matrixCursor = new MatrixCursor(a);
|
||||||
|
MatrixCursor.RowBuilder rowBuilder = matrixCursor.newRow();
|
||||||
|
Pack pack = contentJson.getPacks().get(0);
|
||||||
|
if (pack != null) {
|
||||||
|
rowBuilder.add(contentJson.getStoreLink());
|
||||||
|
rowBuilder.add(contentJson.getIosLink());
|
||||||
|
rowBuilder.add(pack.getTrayName());
|
||||||
|
rowBuilder.add(pack.getIdentifier());
|
||||||
|
rowBuilder.add(pack.getName());
|
||||||
|
rowBuilder.add(pack.getPublisherFull());
|
||||||
|
rowBuilder.add(pack.getEmail());
|
||||||
|
rowBuilder.add(pack.getWebsitePublisher());
|
||||||
|
rowBuilder.add(pack.getWebsiteLicense());
|
||||||
|
rowBuilder.add(pack.getWebsitePrivacy());
|
||||||
|
if (pack.isAnimated()) {
|
||||||
|
rowBuilder.add(1);
|
||||||
|
} else {
|
||||||
|
rowBuilder.add(0);
|
||||||
|
}
|
||||||
|
|
||||||
|
return matrixCursor;
|
||||||
|
}
|
||||||
|
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,31 @@
|
|||||||
|
package emoticon.wasticker.app.manager;
|
||||||
|
|
||||||
|
import android.content.Context;
|
||||||
|
import android.content.SharedPreferences;
|
||||||
|
|
||||||
|
import emoticon.wasticker.app.App;
|
||||||
|
|
||||||
|
public abstract class SPManager {
|
||||||
|
|
||||||
|
private static SharedPreferences sp;
|
||||||
|
|
||||||
|
private static SharedPreferences.Editor editor;
|
||||||
|
|
||||||
|
public static void init(Context context) {
|
||||||
|
if (sp == null) {
|
||||||
|
sp = context.getSharedPreferences("sp_name", Context.MODE_PRIVATE);
|
||||||
|
editor = sp.edit();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void putJsonFilePath(String key, String jsonFilePath) {
|
||||||
|
editor.putString(key, jsonFilePath);
|
||||||
|
editor.apply();
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public static String queryJsonFile(String key) {
|
||||||
|
String string = sp.getString(key, "");
|
||||||
|
return string;
|
||||||
|
}
|
||||||
|
}
|
||||||
33
app/src/main/java/emoticon/wasticker/app/manager/Unit.java
Normal file
@ -0,0 +1,33 @@
|
|||||||
|
package emoticon.wasticker.app.manager;
|
||||||
|
|
||||||
|
import android.content.Context;
|
||||||
|
|
||||||
|
import java.io.BufferedReader;
|
||||||
|
import java.io.IOException;
|
||||||
|
import java.io.InputStream;
|
||||||
|
import java.io.InputStreamReader;
|
||||||
|
import java.io.StringWriter;
|
||||||
|
|
||||||
|
public class Unit {
|
||||||
|
|
||||||
|
public static int dpToPx(Context context, int dp) {
|
||||||
|
float density = context.getResources().getDisplayMetrics().density;
|
||||||
|
return Math.round(dp * density);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static String fileToString(InputStream fileInputStream) {
|
||||||
|
try {
|
||||||
|
char[] charArray = new char[fileInputStream.available()];
|
||||||
|
int readCount = 0;
|
||||||
|
InputStreamReader streamReader = new InputStreamReader(fileInputStream);
|
||||||
|
BufferedReader bufferedReader =new BufferedReader(streamReader);
|
||||||
|
StringWriter stringWriter =new StringWriter();
|
||||||
|
while ((readCount = bufferedReader.read(charArray))!=-1){
|
||||||
|
stringWriter.write(charArray, 0, readCount);
|
||||||
|
}
|
||||||
|
return stringWriter.toString();
|
||||||
|
} catch (IOException exception) {
|
||||||
|
return "";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
40
app/src/main/java/emoticon/wasticker/app/manager/Values.java
Normal file
@ -0,0 +1,40 @@
|
|||||||
|
package emoticon.wasticker.app.manager;
|
||||||
|
|
||||||
|
public abstract class Values {
|
||||||
|
|
||||||
|
public static final String ZIP_KEY = "zip_url_key";
|
||||||
|
public static final String identifierName_KEY = "identifierName_key";
|
||||||
|
|
||||||
|
public static final String TITLE_KEY = "title_key";
|
||||||
|
|
||||||
|
public static final String AUTHOR = "emoticon.wasticker.app.provider.StickerProvider";
|
||||||
|
public static final String STICKER_ACTION = "com.whatsapp.intent.action.ENABLE_STICKER_PACK";
|
||||||
|
public static final String KEY_PackID = "sticker_pack_id";
|
||||||
|
public static final String KEY_PackAUTHORITY = "sticker_pack_authority";
|
||||||
|
public static final String KEY_PackNAME = "sticker_pack_name";
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
public static final String STICKER_IDENTIFIER = "sticker_pack_identifier";
|
||||||
|
public static final String STICKER_NAME = "sticker_pack_name";
|
||||||
|
public static final String STICKER_PUBLISHER = "sticker_pack_publisher";
|
||||||
|
public static final String STICKER_TRAY = "sticker_pack_icon";
|
||||||
|
public static final String ANDROID_LINK = "android_play_store_link";
|
||||||
|
public static final String IOS_LINK = "ios_app_download_link";
|
||||||
|
public static final String EMAIL = "sticker_pack_publisher_email";
|
||||||
|
public static final String WEBSITE_PUBLISH = "sticker_pack_publisher_website";
|
||||||
|
public static final String WEBSITE_POLICY = "sticker_pack_privacy_policy_website";
|
||||||
|
public static final String WEBSITE_LICENSE = "sticker_pack_license_agreement_website";
|
||||||
|
public static final String ANIMATED = "animated_sticker_pack";
|
||||||
|
public static final String STICKER_FILE_NAME = "sticker_file_name";
|
||||||
|
public static final String STICKER_EMOJI = "sticker_emoji";
|
||||||
|
|
||||||
|
public static final String METADATA = "metadata";
|
||||||
|
|
||||||
|
public static final int METADATA_CODE_FOR_SINGLE_PACK = 2;
|
||||||
|
|
||||||
|
public static final String STICKERS = "stickers";
|
||||||
|
public static final int STICKERS_CODE = 3;
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@ -0,0 +1,126 @@
|
|||||||
|
package emoticon.wasticker.app.provider;
|
||||||
|
|
||||||
|
import android.content.ContentProvider;
|
||||||
|
import android.content.ContentValues;
|
||||||
|
import android.content.Context;
|
||||||
|
import android.content.UriMatcher;
|
||||||
|
import android.content.res.AssetFileDescriptor;
|
||||||
|
import android.database.Cursor;
|
||||||
|
import android.database.MatrixCursor;
|
||||||
|
import android.net.Uri;
|
||||||
|
import android.os.ParcelFileDescriptor;
|
||||||
|
|
||||||
|
import androidx.annotation.NonNull;
|
||||||
|
import androidx.annotation.Nullable;
|
||||||
|
|
||||||
|
import java.io.File;
|
||||||
|
import java.io.FileNotFoundException;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
|
||||||
|
import emoticon.wasticker.app.R;
|
||||||
|
import emoticon.wasticker.app.data.pack.ContentJson;
|
||||||
|
import emoticon.wasticker.app.manager.ProviderManager;
|
||||||
|
import emoticon.wasticker.app.manager.Values;
|
||||||
|
|
||||||
|
public class MyProvider extends ContentProvider {
|
||||||
|
|
||||||
|
private UriMatcher uriMatcher = new UriMatcher(UriMatcher.NO_MATCH);
|
||||||
|
|
||||||
|
private Context mContext;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean onCreate() {
|
||||||
|
|
||||||
|
mContext = getContext();
|
||||||
|
assert mContext != null;
|
||||||
|
if (!Values.AUTHOR.startsWith(mContext.getPackageName())) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
// uriMatcher.addURI(Values.AUTHOR, Values.METADATA, Values.METADATA_CODE);
|
||||||
|
uriMatcher.addURI(Values.AUTHOR, Values.METADATA + "/*", Values.METADATA_CODE_FOR_SINGLE_PACK);
|
||||||
|
uriMatcher.addURI(Values.AUTHOR, Values.STICKERS + "/*", Values.STICKERS_CODE);
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Nullable
|
||||||
|
@Override
|
||||||
|
public Cursor query(@NonNull Uri uri, @Nullable String[] projection, @Nullable String selection, @Nullable String[] selectionArgs, @Nullable String sortOrder) {
|
||||||
|
|
||||||
|
int match = uriMatcher.match(uri);
|
||||||
|
|
||||||
|
ContentJson contentJson = ProviderManager.getPack(uri.getLastPathSegment());
|
||||||
|
if(contentJson == null)return null;
|
||||||
|
|
||||||
|
if (match == Values.STICKERS_CODE) {
|
||||||
|
MatrixCursor cursor = ProviderManager.getCursorThree(contentJson);
|
||||||
|
cursor.setNotificationUri(mContext.getContentResolver(), uri);
|
||||||
|
return cursor;
|
||||||
|
|
||||||
|
} else if (match == Values.METADATA_CODE_FOR_SINGLE_PACK) {
|
||||||
|
MatrixCursor matrixCursor = ProviderManager.getCursorTwo(contentJson);
|
||||||
|
if(matrixCursor!= null){
|
||||||
|
matrixCursor.setNotificationUri(mContext.getContentResolver(), uri);
|
||||||
|
return matrixCursor;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Nullable
|
||||||
|
@Override
|
||||||
|
public String getType(@NonNull Uri uri) {
|
||||||
|
|
||||||
|
if (uriMatcher.match(uri) == Values.STICKERS_CODE) {
|
||||||
|
|
||||||
|
return String.format(mContext.getString(R.string.match_type_sticker), Values.AUTHOR, Values.STICKERS);
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Nullable
|
||||||
|
@Override
|
||||||
|
public AssetFileDescriptor openAssetFile(@NonNull Uri uri, @NonNull String mode) throws FileNotFoundException {
|
||||||
|
List<String> pathSegments = uri.getPathSegments();
|
||||||
|
if (pathSegments.size() < 3) return null;
|
||||||
|
String fileName = pathSegments.get(pathSegments.size() - 1);
|
||||||
|
String identifierName = pathSegments.get(pathSegments.size() - 2);
|
||||||
|
if (fileName.isEmpty() || identifierName.isEmpty()) return null;
|
||||||
|
|
||||||
|
String fileDir = ProviderManager.getFileDir(identifierName);
|
||||||
|
|
||||||
|
String path = fileDir + fileName;
|
||||||
|
|
||||||
|
File file = new File(path);
|
||||||
|
if (file.exists()) {
|
||||||
|
return new AssetFileDescriptor(
|
||||||
|
ParcelFileDescriptor.open(
|
||||||
|
file,
|
||||||
|
ParcelFileDescriptor.MODE_READ_ONLY
|
||||||
|
), 0L, -1L);
|
||||||
|
} else {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
// return super.openAssetFile(uri, mode);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Nullable
|
||||||
|
@Override
|
||||||
|
public Uri insert(@NonNull Uri uri, @Nullable ContentValues values) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int delete(@NonNull Uri uri, @Nullable String selection, @Nullable String[] selectionArgs) {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int update(@NonNull Uri uri, @Nullable ContentValues values, @Nullable String selection, @Nullable String[] selectionArgs) {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
235
app/src/main/java/emoticon/wasticker/app/view/AddActivity.java
Normal file
@ -0,0 +1,235 @@
|
|||||||
|
package emoticon.wasticker.app.view;
|
||||||
|
|
||||||
|
import android.content.Intent;
|
||||||
|
import android.os.Bundle;
|
||||||
|
import android.util.Log;
|
||||||
|
import android.view.View;
|
||||||
|
import android.widget.ImageView;
|
||||||
|
import android.widget.ProgressBar;
|
||||||
|
import android.widget.TextView;
|
||||||
|
import android.widget.Toast;
|
||||||
|
|
||||||
|
import androidx.appcompat.app.AppCompatActivity;
|
||||||
|
import androidx.recyclerview.widget.GridLayoutManager;
|
||||||
|
import androidx.recyclerview.widget.RecyclerView;
|
||||||
|
|
||||||
|
import com.applovin.mediation.MaxAd;
|
||||||
|
import com.applovin.mediation.MaxError;
|
||||||
|
import com.applovin.mediation.ads.MaxInterstitialAd;
|
||||||
|
import com.bumptech.glide.Glide;
|
||||||
|
|
||||||
|
import java.io.File;
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Objects;
|
||||||
|
|
||||||
|
|
||||||
|
import emoticon.wasticker.app.initadapter.sticker.StickerAdapter;
|
||||||
|
import emoticon.wasticker.app.listener.AdListener;
|
||||||
|
import emoticon.wasticker.app.listener.DownloadListener;
|
||||||
|
import emoticon.wasticker.app.manager.AdLoad;
|
||||||
|
import emoticon.wasticker.app.manager.Download;
|
||||||
|
import emoticon.wasticker.app.manager.SPManager;
|
||||||
|
import emoticon.wasticker.app.manager.Values;
|
||||||
|
import emoticon.wasticker.app.R;
|
||||||
|
|
||||||
|
public class AddActivity extends AppCompatActivity implements DownloadListener, View.OnClickListener, AdListener {
|
||||||
|
|
||||||
|
private String zipUrl;
|
||||||
|
private String identifierName;
|
||||||
|
|
||||||
|
private ImageView backImage;
|
||||||
|
private ImageView trayImage;
|
||||||
|
|
||||||
|
private TextView textViewTitle;
|
||||||
|
private RecyclerView recyclerViewSticker;
|
||||||
|
|
||||||
|
private StickerAdapter stickerAdapter;
|
||||||
|
private ProgressBar progressBar;
|
||||||
|
|
||||||
|
private List<File> data = new ArrayList<>();
|
||||||
|
private String title;
|
||||||
|
|
||||||
|
private TextView addTV;
|
||||||
|
|
||||||
|
private List<MaxInterstitialAd> ads;
|
||||||
|
|
||||||
|
private int type = 0;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void onCreate(Bundle savedInstanceState) {
|
||||||
|
super.onCreate(savedInstanceState);
|
||||||
|
setContentView(R.layout.activity_add);
|
||||||
|
ads = AdLoad.createAd(AddActivity.this);
|
||||||
|
loadAd();
|
||||||
|
progressBar = findViewById(R.id.progressbar);
|
||||||
|
backImage = findViewById(R.id.back_im);
|
||||||
|
trayImage = findViewById(R.id.tray_im);
|
||||||
|
textViewTitle = findViewById(R.id.sticker_title_tv);
|
||||||
|
recyclerViewSticker = findViewById(R.id.recycler_sticker);
|
||||||
|
addTV = findViewById(R.id.add_whatsapp_tv);
|
||||||
|
|
||||||
|
backImage.setOnClickListener(this);
|
||||||
|
addTV.setOnClickListener(this);
|
||||||
|
|
||||||
|
zipUrl = getIntent().getStringExtra(Values.ZIP_KEY);
|
||||||
|
title = getIntent().getStringExtra(Values.TITLE_KEY);
|
||||||
|
identifierName = getIntent().getStringExtra(Values.identifierName_KEY);
|
||||||
|
|
||||||
|
textViewTitle.setText(title);
|
||||||
|
initStickerShow();
|
||||||
|
String newPath = getCacheDir() + "/" + identifierName;
|
||||||
|
|
||||||
|
|
||||||
|
if (zipUrl != null) {
|
||||||
|
File file = new File(newPath);
|
||||||
|
if (!file.exists()) {
|
||||||
|
Download.startDownloadFile(AddActivity.this, zipUrl, newPath, this);
|
||||||
|
} else {
|
||||||
|
refreshData(newPath);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
private void loadAd() {
|
||||||
|
for (int i = 0; i < ads.size() ; i++) {
|
||||||
|
MaxInterstitialAd maxInterstitialAd = ads.get(i);
|
||||||
|
AdLoad.setAdShowListener(maxInterstitialAd, AddActivity.this);
|
||||||
|
maxInterstitialAd.loadAd();
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
private void initStickerShow() {
|
||||||
|
stickerAdapter = new StickerAdapter(AddActivity.this);
|
||||||
|
recyclerViewSticker.setAdapter(stickerAdapter);
|
||||||
|
recyclerViewSticker.setLayoutManager(new GridLayoutManager(AddActivity.this, 3));
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void downloadListener(Boolean isDownloadSuccess, Boolean isUnzipSuccess, String newPath) {
|
||||||
|
if (!isDownloadSuccess || !isUnzipSuccess) {
|
||||||
|
progressBar.setVisibility(View.GONE);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
refreshData(newPath);
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
private void refreshData(String newPath) {
|
||||||
|
File file = new File(newPath);
|
||||||
|
if (!file.exists()) {
|
||||||
|
progressBar.setVisibility(View.GONE);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
File[] filesList = file.listFiles();
|
||||||
|
if (filesList == null) {
|
||||||
|
progressBar.setVisibility(View.GONE);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
for (File listFile : filesList) {
|
||||||
|
String name = listFile.getName();
|
||||||
|
if (name.equals("tray.webp")) {
|
||||||
|
Glide.with(AddActivity.this).load(listFile).into(trayImage);
|
||||||
|
} else if (listFile.getName().endsWith(".webp")) {
|
||||||
|
data.add(listFile);
|
||||||
|
} else {
|
||||||
|
SPManager.putJsonFilePath(identifierName, listFile.getAbsolutePath());
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
stickerAdapter.setList(data);
|
||||||
|
progressBar.setVisibility(View.GONE);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onBackPressed() {
|
||||||
|
super.onBackPressed();
|
||||||
|
type = 0;
|
||||||
|
showAd();
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onClick(View v) {
|
||||||
|
int id = v.getId();
|
||||||
|
if (id == R.id.back_im) {
|
||||||
|
type = 0;
|
||||||
|
boolean b = showAd();
|
||||||
|
finish();
|
||||||
|
} else if (id == R.id.add_whatsapp_tv) {
|
||||||
|
type = 1;
|
||||||
|
boolean b = showAd();
|
||||||
|
if (!b) {
|
||||||
|
addWhatsApp();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
private boolean showAd() {
|
||||||
|
MaxInterstitialAd maxInterstitialAd = AdLoad.showMyAd(ads);
|
||||||
|
if (maxInterstitialAd != null) {
|
||||||
|
maxInterstitialAd.showAd();
|
||||||
|
return true;
|
||||||
|
} else {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onShowFail(MaxAd ad) {
|
||||||
|
if(type == 1) {
|
||||||
|
addWhatsApp();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onShowSuccess(MaxAd ad) {
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onHidden() {
|
||||||
|
if(type == 1){
|
||||||
|
loadAd();
|
||||||
|
addWhatsApp();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onLoadFail(String string, MaxError maxError) {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onLoadSuccess(MaxAd ad) {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
private void addWhatsApp() {
|
||||||
|
Intent intent = new Intent();
|
||||||
|
intent.setAction(Values.STICKER_ACTION);
|
||||||
|
intent.putExtra(Values.KEY_PackID, identifierName);
|
||||||
|
intent.putExtra(Values.KEY_PackAUTHORITY, Values.AUTHOR);
|
||||||
|
intent.putExtra(Values.KEY_PackNAME, title);
|
||||||
|
try {
|
||||||
|
startActivityForResult(intent, 200);
|
||||||
|
} catch (Exception ex) {
|
||||||
|
Toast.makeText(AddActivity.this, getString(R.string.add_fail), Toast.LENGTH_SHORT).show();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void onDestroy() {
|
||||||
|
super.onDestroy();
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,159 @@
|
|||||||
|
package emoticon.wasticker.app.view;
|
||||||
|
|
||||||
|
import androidx.appcompat.app.AppCompatActivity;
|
||||||
|
|
||||||
|
import android.content.Intent;
|
||||||
|
import android.os.Bundle;
|
||||||
|
import android.os.CountDownTimer;
|
||||||
|
import android.util.Log;
|
||||||
|
|
||||||
|
import com.applovin.mediation.MaxAd;
|
||||||
|
import com.applovin.mediation.MaxError;
|
||||||
|
import com.applovin.mediation.ads.MaxInterstitialAd;
|
||||||
|
import com.applovin.sdk.AppLovinSdk;
|
||||||
|
import com.applovin.sdk.AppLovinSdkConfiguration;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import emoticon.wasticker.app.App;
|
||||||
|
import emoticon.wasticker.app.R;
|
||||||
|
import emoticon.wasticker.app.listener.AdListener;
|
||||||
|
import emoticon.wasticker.app.manager.AdLoad;
|
||||||
|
|
||||||
|
|
||||||
|
public class FirstOpenActivity extends AppCompatActivity implements AdListener {
|
||||||
|
|
||||||
|
|
||||||
|
private CountDownTimer countDownTimer;
|
||||||
|
|
||||||
|
private List<MaxInterstitialAd> ads;
|
||||||
|
|
||||||
|
private boolean hasShow = false;
|
||||||
|
|
||||||
|
private void initSDK() {
|
||||||
|
AppLovinSdk instance = AppLovinSdk.getInstance(this);
|
||||||
|
instance.setMediationProvider("max");
|
||||||
|
instance.initializeSdk(new AppLovinSdk.SdkInitializationListener() {
|
||||||
|
@Override
|
||||||
|
public void onSdkInitialized(AppLovinSdkConfiguration appLovinSdkConfiguration) {
|
||||||
|
countDownTimer.start();
|
||||||
|
ads = AdLoad.createAd(FirstOpenActivity.this);
|
||||||
|
for (int i = 0; i < ads.size() ; i++) {
|
||||||
|
MaxInterstitialAd maxInterstitialAd = ads.get(i);
|
||||||
|
maxInterstitialAd.loadAd();
|
||||||
|
AdLoad.setAdShowListener(maxInterstitialAd, FirstOpenActivity.this);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void onCreate(Bundle savedInstanceState) {
|
||||||
|
super.onCreate(savedInstanceState);
|
||||||
|
setContentView(R.layout.activity_first_open);
|
||||||
|
countDownTimer = new CountDownTimer(11000, 100) {
|
||||||
|
@Override
|
||||||
|
public void onTick(long millisUntilFinished) {
|
||||||
|
if (!hasShow) {
|
||||||
|
startShow();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onFinish() {
|
||||||
|
if (!hasShow) {
|
||||||
|
MaxInterstitialAd maxInterstitialAd = AdLoad.showMyAd(ads);
|
||||||
|
if (maxInterstitialAd != null) {
|
||||||
|
hasShow = true;
|
||||||
|
AdLoad.setAdShowListener(maxInterstitialAd, new AdListener() {
|
||||||
|
@Override
|
||||||
|
public void onShowFail(MaxAd ad) {
|
||||||
|
goMain();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onShowSuccess(MaxAd ad) {
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onHidden() {
|
||||||
|
goMain();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onLoadFail(String string, MaxError maxError) {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onLoadSuccess(MaxAd ad) {
|
||||||
|
|
||||||
|
}
|
||||||
|
});
|
||||||
|
maxInterstitialAd.showAd();
|
||||||
|
}else {
|
||||||
|
goMain();
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
};
|
||||||
|
initSDK();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void startShow() {
|
||||||
|
MaxInterstitialAd maxInterstitialAd = AdLoad.showMyAd(ads);
|
||||||
|
if (maxInterstitialAd != null) {
|
||||||
|
hasShow = true;
|
||||||
|
maxInterstitialAd.showAd();
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void onDestroy() {
|
||||||
|
super.onDestroy();
|
||||||
|
if (countDownTimer != null) {
|
||||||
|
countDownTimer.cancel();
|
||||||
|
countDownTimer = null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onShowFail(MaxAd ad) {
|
||||||
|
hasShow = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onShowSuccess(MaxAd ad) {
|
||||||
|
hasShow = true;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onHidden() {
|
||||||
|
goMain();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
private void goMain(){
|
||||||
|
Intent intent = new Intent(FirstOpenActivity.this, MainActivity.class);
|
||||||
|
startActivity(intent);
|
||||||
|
finish();
|
||||||
|
}
|
||||||
|
@Override
|
||||||
|
public void onLoadFail(String str, MaxError maxError) {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onLoadSuccess(MaxAd ad) {
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,89 @@
|
|||||||
|
package emoticon.wasticker.app.view;
|
||||||
|
|
||||||
|
import android.annotation.SuppressLint;
|
||||||
|
import android.content.Intent;
|
||||||
|
import android.os.Bundle;
|
||||||
|
|
||||||
|
import androidx.fragment.app.Fragment;
|
||||||
|
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||||
|
import androidx.recyclerview.widget.RecyclerView;
|
||||||
|
|
||||||
|
import android.view.LayoutInflater;
|
||||||
|
import android.view.View;
|
||||||
|
import android.view.ViewGroup;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.util.Collections;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
|
||||||
|
import emoticon.wasticker.app.initadapter.home.HomeAdapter;
|
||||||
|
import emoticon.wasticker.app.listener.HomeClickListener;
|
||||||
|
import emoticon.wasticker.app.manager.Values;
|
||||||
|
import emoticon.wasticker.app.R;
|
||||||
|
import emoticon.wasticker.app.data.DataChildnew;
|
||||||
|
|
||||||
|
public class HomeFragment extends Fragment implements HomeClickListener {
|
||||||
|
|
||||||
|
|
||||||
|
private static final String ARG_PARAM1 = "param_key";
|
||||||
|
|
||||||
|
|
||||||
|
private List<DataChildnew> list;
|
||||||
|
|
||||||
|
private RecyclerView recyclerView;
|
||||||
|
|
||||||
|
|
||||||
|
public HomeFragment() {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public static HomeFragment newInstance(List<DataChildnew> param) {
|
||||||
|
HomeFragment fragment = new HomeFragment();
|
||||||
|
Bundle args = new Bundle();
|
||||||
|
args.putSerializable(ARG_PARAM1, (Serializable) param);
|
||||||
|
fragment.setArguments(args);
|
||||||
|
return fragment;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onCreate(Bundle savedInstanceState) {
|
||||||
|
super.onCreate(savedInstanceState);
|
||||||
|
if (getArguments() != null) {
|
||||||
|
list = (List<DataChildnew>) getArguments().getSerializable(ARG_PARAM1);
|
||||||
|
Collections.shuffle(list);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@SuppressLint("MissingInflatedId")
|
||||||
|
@Override
|
||||||
|
public View onCreateView(LayoutInflater inflater, ViewGroup container,
|
||||||
|
Bundle savedInstanceState) {
|
||||||
|
View view = inflater.inflate(R.layout.fragment_home, container, false);
|
||||||
|
recyclerView = (RecyclerView) view.findViewById(R.id.recycler_list);
|
||||||
|
setView();
|
||||||
|
return view;
|
||||||
|
}
|
||||||
|
|
||||||
|
private void setView() {
|
||||||
|
HomeAdapter homeAdapter = new HomeAdapter(list, requireContext());
|
||||||
|
homeAdapter.setListener(this);
|
||||||
|
recyclerView.setLayoutManager(new LinearLayoutManager(requireContext()));
|
||||||
|
recyclerView.setAdapter(homeAdapter);
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onHomeClickListener(DataChildnew dataChildnew) {
|
||||||
|
Intent intent = new Intent();
|
||||||
|
intent.putExtra(Values.ZIP_KEY, dataChildnew.getZipUrl());
|
||||||
|
intent.putExtra(Values.TITLE_KEY, dataChildnew.getTitle());
|
||||||
|
intent.putExtra(Values.identifierName_KEY, dataChildnew.getIdentifierName());
|
||||||
|
intent.setClass(requireContext(), AddActivity.class);
|
||||||
|
startActivity(intent);
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,80 @@
|
|||||||
|
package emoticon.wasticker.app.view;
|
||||||
|
|
||||||
|
import androidx.annotation.NonNull;
|
||||||
|
import androidx.annotation.Nullable;
|
||||||
|
import androidx.appcompat.app.AppCompatActivity;
|
||||||
|
import androidx.fragment.app.Fragment;
|
||||||
|
import androidx.fragment.app.FragmentStatePagerAdapter;
|
||||||
|
import androidx.viewpager.widget.ViewPager;
|
||||||
|
|
||||||
|
import android.os.Bundle;
|
||||||
|
|
||||||
|
import com.google.android.material.tabs.TabLayout;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import emoticon.wasticker.app.App;
|
||||||
|
|
||||||
|
import emoticon.wasticker.app.R;
|
||||||
|
import emoticon.wasticker.app.data.Data;
|
||||||
|
|
||||||
|
public class MainActivity extends AppCompatActivity {
|
||||||
|
private TabLayout tabLayout;
|
||||||
|
private ViewPager viewpager;
|
||||||
|
|
||||||
|
private List<Fragment> fragmentList = new ArrayList<>();
|
||||||
|
|
||||||
|
private List<String> tabTitles = new ArrayList<>();
|
||||||
|
|
||||||
|
private FragmentStatePagerAdapter fragmentStatePagerAdapter;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void onCreate(Bundle savedInstanceState) {
|
||||||
|
super.onCreate(savedInstanceState);
|
||||||
|
setContentView(R.layout.activity_main);
|
||||||
|
tabLayout = (TabLayout) findViewById(R.id.category_tab);
|
||||||
|
viewpager = (ViewPager) findViewById(R.id.tab_vp);
|
||||||
|
|
||||||
|
|
||||||
|
for (Data data : App.getData()) {
|
||||||
|
String categoryName = data.getCategoryName();
|
||||||
|
tabTitles.add(categoryName);
|
||||||
|
fragmentList.add(HomeFragment.newInstance(data.getChildList()));
|
||||||
|
}
|
||||||
|
viewpager.setAdapter(initAdapter());
|
||||||
|
|
||||||
|
for (int i = 0; i < fragmentList.size(); i++) {
|
||||||
|
TabLayout.Tab tab = tabLayout.newTab();
|
||||||
|
tabLayout.addTab(tab);
|
||||||
|
}
|
||||||
|
tabLayout.setupWithViewPager(viewpager);
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
private FragmentStatePagerAdapter initAdapter() {
|
||||||
|
if (fragmentStatePagerAdapter == null) {
|
||||||
|
fragmentStatePagerAdapter = new FragmentStatePagerAdapter(getSupportFragmentManager()) {
|
||||||
|
@NonNull
|
||||||
|
@Override
|
||||||
|
public Fragment getItem(int position) {
|
||||||
|
return fragmentList.get(position);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int getCount() {
|
||||||
|
return fragmentList.size();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Nullable
|
||||||
|
@Override
|
||||||
|
public CharSequence getPageTitle(int position) {
|
||||||
|
return tabTitles.get(position);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
return fragmentStatePagerAdapter;
|
||||||
|
}
|
||||||
|
}
|
||||||
30
app/src/main/res/drawable-v24/ic_launcher_foreground.xml
Normal file
@ -0,0 +1,30 @@
|
|||||||
|
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
xmlns:aapt="http://schemas.android.com/aapt"
|
||||||
|
android:width="108dp"
|
||||||
|
android:height="108dp"
|
||||||
|
android:viewportWidth="108"
|
||||||
|
android:viewportHeight="108">
|
||||||
|
<path android:pathData="M31,63.928c0,0 6.4,-11 12.1,-13.1c7.2,-2.6 26,-1.4 26,-1.4l38.1,38.1L107,108.928l-32,-1L31,63.928z">
|
||||||
|
<aapt:attr name="android:fillColor">
|
||||||
|
<gradient
|
||||||
|
android:endX="85.84757"
|
||||||
|
android:endY="92.4963"
|
||||||
|
android:startX="42.9492"
|
||||||
|
android:startY="49.59793"
|
||||||
|
android:type="linear">
|
||||||
|
<item
|
||||||
|
android:color="#44000000"
|
||||||
|
android:offset="0.0" />
|
||||||
|
<item
|
||||||
|
android:color="#00000000"
|
||||||
|
android:offset="1.0" />
|
||||||
|
</gradient>
|
||||||
|
</aapt:attr>
|
||||||
|
</path>
|
||||||
|
<path
|
||||||
|
android:fillColor="#FFFFFF"
|
||||||
|
android:fillType="nonZero"
|
||||||
|
android:pathData="M65.3,45.828l3.8,-6.6c0.2,-0.4 0.1,-0.9 -0.3,-1.1c-0.4,-0.2 -0.9,-0.1 -1.1,0.3l-3.9,6.7c-6.3,-2.8 -13.4,-2.8 -19.7,0l-3.9,-6.7c-0.2,-0.4 -0.7,-0.5 -1.1,-0.3C38.8,38.328 38.7,38.828 38.9,39.228l3.8,6.6C36.2,49.428 31.7,56.028 31,63.928h46C76.3,56.028 71.8,49.428 65.3,45.828zM43.4,57.328c-0.8,0 -1.5,-0.5 -1.8,-1.2c-0.3,-0.7 -0.1,-1.5 0.4,-2.1c0.5,-0.5 1.4,-0.7 2.1,-0.4c0.7,0.3 1.2,1 1.2,1.8C45.3,56.528 44.5,57.328 43.4,57.328L43.4,57.328zM64.6,57.328c-0.8,0 -1.5,-0.5 -1.8,-1.2s-0.1,-1.5 0.4,-2.1c0.5,-0.5 1.4,-0.7 2.1,-0.4c0.7,0.3 1.2,1 1.2,1.8C66.5,56.528 65.6,57.328 64.6,57.328L64.6,57.328z"
|
||||||
|
android:strokeWidth="1"
|
||||||
|
android:strokeColor="#00000000" />
|
||||||
|
</vector>
|
||||||
7
app/src/main/res/drawable/add_sticker.xml
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<shape xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:shape="rectangle">
|
||||||
|
<corners android:radius="5dp"/>
|
||||||
|
<solid android:color="@color/color_43CD80"/>
|
||||||
|
|
||||||
|
</shape>
|
||||||
7
app/src/main/res/drawable/circle_home_preview.xml
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<shape xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:shape="rectangle">
|
||||||
|
<corners android:radius="2dp"/>
|
||||||
|
<solid android:color="@color/color_BFEFFF"/>
|
||||||
|
|
||||||
|
</shape>
|
||||||
170
app/src/main/res/drawable/ic_launcher_background.xml
Normal file
@ -0,0 +1,170 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:width="108dp"
|
||||||
|
android:height="108dp"
|
||||||
|
android:viewportWidth="108"
|
||||||
|
android:viewportHeight="108">
|
||||||
|
<path
|
||||||
|
android:fillColor="#3DDC84"
|
||||||
|
android:pathData="M0,0h108v108h-108z" />
|
||||||
|
<path
|
||||||
|
android:fillColor="#00000000"
|
||||||
|
android:pathData="M9,0L9,108"
|
||||||
|
android:strokeWidth="0.8"
|
||||||
|
android:strokeColor="#33FFFFFF" />
|
||||||
|
<path
|
||||||
|
android:fillColor="#00000000"
|
||||||
|
android:pathData="M19,0L19,108"
|
||||||
|
android:strokeWidth="0.8"
|
||||||
|
android:strokeColor="#33FFFFFF" />
|
||||||
|
<path
|
||||||
|
android:fillColor="#00000000"
|
||||||
|
android:pathData="M29,0L29,108"
|
||||||
|
android:strokeWidth="0.8"
|
||||||
|
android:strokeColor="#33FFFFFF" />
|
||||||
|
<path
|
||||||
|
android:fillColor="#00000000"
|
||||||
|
android:pathData="M39,0L39,108"
|
||||||
|
android:strokeWidth="0.8"
|
||||||
|
android:strokeColor="#33FFFFFF" />
|
||||||
|
<path
|
||||||
|
android:fillColor="#00000000"
|
||||||
|
android:pathData="M49,0L49,108"
|
||||||
|
android:strokeWidth="0.8"
|
||||||
|
android:strokeColor="#33FFFFFF" />
|
||||||
|
<path
|
||||||
|
android:fillColor="#00000000"
|
||||||
|
android:pathData="M59,0L59,108"
|
||||||
|
android:strokeWidth="0.8"
|
||||||
|
android:strokeColor="#33FFFFFF" />
|
||||||
|
<path
|
||||||
|
android:fillColor="#00000000"
|
||||||
|
android:pathData="M69,0L69,108"
|
||||||
|
android:strokeWidth="0.8"
|
||||||
|
android:strokeColor="#33FFFFFF" />
|
||||||
|
<path
|
||||||
|
android:fillColor="#00000000"
|
||||||
|
android:pathData="M79,0L79,108"
|
||||||
|
android:strokeWidth="0.8"
|
||||||
|
android:strokeColor="#33FFFFFF" />
|
||||||
|
<path
|
||||||
|
android:fillColor="#00000000"
|
||||||
|
android:pathData="M89,0L89,108"
|
||||||
|
android:strokeWidth="0.8"
|
||||||
|
android:strokeColor="#33FFFFFF" />
|
||||||
|
<path
|
||||||
|
android:fillColor="#00000000"
|
||||||
|
android:pathData="M99,0L99,108"
|
||||||
|
android:strokeWidth="0.8"
|
||||||
|
android:strokeColor="#33FFFFFF" />
|
||||||
|
<path
|
||||||
|
android:fillColor="#00000000"
|
||||||
|
android:pathData="M0,9L108,9"
|
||||||
|
android:strokeWidth="0.8"
|
||||||
|
android:strokeColor="#33FFFFFF" />
|
||||||
|
<path
|
||||||
|
android:fillColor="#00000000"
|
||||||
|
android:pathData="M0,19L108,19"
|
||||||
|
android:strokeWidth="0.8"
|
||||||
|
android:strokeColor="#33FFFFFF" />
|
||||||
|
<path
|
||||||
|
android:fillColor="#00000000"
|
||||||
|
android:pathData="M0,29L108,29"
|
||||||
|
android:strokeWidth="0.8"
|
||||||
|
android:strokeColor="#33FFFFFF" />
|
||||||
|
<path
|
||||||
|
android:fillColor="#00000000"
|
||||||
|
android:pathData="M0,39L108,39"
|
||||||
|
android:strokeWidth="0.8"
|
||||||
|
android:strokeColor="#33FFFFFF" />
|
||||||
|
<path
|
||||||
|
android:fillColor="#00000000"
|
||||||
|
android:pathData="M0,49L108,49"
|
||||||
|
android:strokeWidth="0.8"
|
||||||
|
android:strokeColor="#33FFFFFF" />
|
||||||
|
<path
|
||||||
|
android:fillColor="#00000000"
|
||||||
|
android:pathData="M0,59L108,59"
|
||||||
|
android:strokeWidth="0.8"
|
||||||
|
android:strokeColor="#33FFFFFF" />
|
||||||
|
<path
|
||||||
|
android:fillColor="#00000000"
|
||||||
|
android:pathData="M0,69L108,69"
|
||||||
|
android:strokeWidth="0.8"
|
||||||
|
android:strokeColor="#33FFFFFF" />
|
||||||
|
<path
|
||||||
|
android:fillColor="#00000000"
|
||||||
|
android:pathData="M0,79L108,79"
|
||||||
|
android:strokeWidth="0.8"
|
||||||
|
android:strokeColor="#33FFFFFF" />
|
||||||
|
<path
|
||||||
|
android:fillColor="#00000000"
|
||||||
|
android:pathData="M0,89L108,89"
|
||||||
|
android:strokeWidth="0.8"
|
||||||
|
android:strokeColor="#33FFFFFF" />
|
||||||
|
<path
|
||||||
|
android:fillColor="#00000000"
|
||||||
|
android:pathData="M0,99L108,99"
|
||||||
|
android:strokeWidth="0.8"
|
||||||
|
android:strokeColor="#33FFFFFF" />
|
||||||
|
<path
|
||||||
|
android:fillColor="#00000000"
|
||||||
|
android:pathData="M19,29L89,29"
|
||||||
|
android:strokeWidth="0.8"
|
||||||
|
android:strokeColor="#33FFFFFF" />
|
||||||
|
<path
|
||||||
|
android:fillColor="#00000000"
|
||||||
|
android:pathData="M19,39L89,39"
|
||||||
|
android:strokeWidth="0.8"
|
||||||
|
android:strokeColor="#33FFFFFF" />
|
||||||
|
<path
|
||||||
|
android:fillColor="#00000000"
|
||||||
|
android:pathData="M19,49L89,49"
|
||||||
|
android:strokeWidth="0.8"
|
||||||
|
android:strokeColor="#33FFFFFF" />
|
||||||
|
<path
|
||||||
|
android:fillColor="#00000000"
|
||||||
|
android:pathData="M19,59L89,59"
|
||||||
|
android:strokeWidth="0.8"
|
||||||
|
android:strokeColor="#33FFFFFF" />
|
||||||
|
<path
|
||||||
|
android:fillColor="#00000000"
|
||||||
|
android:pathData="M19,69L89,69"
|
||||||
|
android:strokeWidth="0.8"
|
||||||
|
android:strokeColor="#33FFFFFF" />
|
||||||
|
<path
|
||||||
|
android:fillColor="#00000000"
|
||||||
|
android:pathData="M19,79L89,79"
|
||||||
|
android:strokeWidth="0.8"
|
||||||
|
android:strokeColor="#33FFFFFF" />
|
||||||
|
<path
|
||||||
|
android:fillColor="#00000000"
|
||||||
|
android:pathData="M29,19L29,89"
|
||||||
|
android:strokeWidth="0.8"
|
||||||
|
android:strokeColor="#33FFFFFF" />
|
||||||
|
<path
|
||||||
|
android:fillColor="#00000000"
|
||||||
|
android:pathData="M39,19L39,89"
|
||||||
|
android:strokeWidth="0.8"
|
||||||
|
android:strokeColor="#33FFFFFF" />
|
||||||
|
<path
|
||||||
|
android:fillColor="#00000000"
|
||||||
|
android:pathData="M49,19L49,89"
|
||||||
|
android:strokeWidth="0.8"
|
||||||
|
android:strokeColor="#33FFFFFF" />
|
||||||
|
<path
|
||||||
|
android:fillColor="#00000000"
|
||||||
|
android:pathData="M59,19L59,89"
|
||||||
|
android:strokeWidth="0.8"
|
||||||
|
android:strokeColor="#33FFFFFF" />
|
||||||
|
<path
|
||||||
|
android:fillColor="#00000000"
|
||||||
|
android:pathData="M69,19L69,89"
|
||||||
|
android:strokeWidth="0.8"
|
||||||
|
android:strokeColor="#33FFFFFF" />
|
||||||
|
<path
|
||||||
|
android:fillColor="#00000000"
|
||||||
|
android:pathData="M79,19L79,89"
|
||||||
|
android:strokeWidth="0.8"
|
||||||
|
android:strokeColor="#33FFFFFF" />
|
||||||
|
</vector>
|
||||||
6
app/src/main/res/drawable/preview_count.xml
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<shape xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:shape="oval">
|
||||||
|
<solid android:color="@color/color_4DFFFFFF"/>
|
||||||
|
|
||||||
|
</shape>
|
||||||
10
app/src/main/res/drawable/sticker_background.xml
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<shape xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:shape="rectangle">
|
||||||
|
|
||||||
|
<corners android:radius="6dp" />
|
||||||
|
<stroke
|
||||||
|
android:width="1dp"
|
||||||
|
android:color="@color/color_theme" />
|
||||||
|
|
||||||
|
</shape>
|
||||||
7
app/src/main/res/drawable/sticker_pos.xml
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<shape xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:shape="rectangle">
|
||||||
|
<corners android:radius="3dp" />
|
||||||
|
<solid android:color="@color/color_4DFFFFFF"/>
|
||||||
|
|
||||||
|
</shape>
|
||||||
95
app/src/main/res/layout/activity_add.xml
Normal file
@ -0,0 +1,95 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||||
|
xmlns:tools="http://schemas.android.com/tools"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
tools:context="emoticon.wasticker.app.view.AddActivity">
|
||||||
|
|
||||||
|
<androidx.cardview.widget.CardView
|
||||||
|
android:id="@+id/cardview"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
app:layout_constraintLeft_toLeftOf="parent"
|
||||||
|
app:layout_constraintTop_toTopOf="parent">
|
||||||
|
|
||||||
|
<RelativeLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:padding="10dp">
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:id="@+id/back_im"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:paddingStart="5dp"
|
||||||
|
android:paddingTop="5dp"
|
||||||
|
android:src="@mipmap/icon_back" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/sticker_title_tv"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_alignTop="@id/tray_im"
|
||||||
|
android:layout_alignBottom="@id/tray_im"
|
||||||
|
android:layout_marginStart="19dp"
|
||||||
|
android:layout_toEndOf="@id/tray_im"
|
||||||
|
android:gravity="center"
|
||||||
|
android:text="@string/app_name"
|
||||||
|
android:textColor="@color/color_1c1c1c"
|
||||||
|
android:textSize="18sp" />
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:id="@+id/tray_im"
|
||||||
|
android:layout_width="55dp"
|
||||||
|
android:layout_height="55dp"
|
||||||
|
android:layout_below="@id/back_im"
|
||||||
|
android:layout_alignStart="@id/back_im"
|
||||||
|
android:layout_marginStart="12dp"
|
||||||
|
android:layout_marginTop="9dp" />
|
||||||
|
</RelativeLayout>
|
||||||
|
</androidx.cardview.widget.CardView>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<androidx.recyclerview.widget.RecyclerView
|
||||||
|
android:id="@+id/recycler_sticker"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="0dp"
|
||||||
|
android:paddingStart="12dp"
|
||||||
|
android:paddingTop="12dp"
|
||||||
|
android:paddingEnd="12dp"
|
||||||
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
|
app:layout_constraintTop_toBottomOf="@id/cardview" />
|
||||||
|
|
||||||
|
<ProgressBar
|
||||||
|
android:id="@+id/progressbar"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
|
app:layout_constraintLeft_toLeftOf="parent"
|
||||||
|
app:layout_constraintRight_toRightOf="parent"
|
||||||
|
android:indeterminateTint="@color/color_43CD80"
|
||||||
|
app:layout_constraintTop_toTopOf="parent" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/add_whatsapp_tv"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginEnd="25dp"
|
||||||
|
android:layout_marginBottom="60dp"
|
||||||
|
android:background="@drawable/add_sticker"
|
||||||
|
android:paddingStart="15dp"
|
||||||
|
android:paddingTop="5dp"
|
||||||
|
android:paddingEnd="15dp"
|
||||||
|
android:paddingBottom="5dp"
|
||||||
|
android:text="@string/add_whatsapp"
|
||||||
|
android:textColor="@color/white"
|
||||||
|
android:textSize="16sp"
|
||||||
|
android:textStyle="bold"
|
||||||
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
|
app:layout_constraintRight_toRightOf="parent" />
|
||||||
|
|
||||||
|
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||||
34
app/src/main/res/layout/activity_first_open.xml
Normal file
@ -0,0 +1,34 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
xmlns:tools="http://schemas.android.com/tools"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
tools:context="emoticon.wasticker.app.view.FirstOpenActivity">
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:id="@+id/Sticker_logo"
|
||||||
|
android:layout_width="75dp"
|
||||||
|
android:layout_height="75dp"
|
||||||
|
android:layout_centerInParent="true"
|
||||||
|
android:src="@mipmap/sticker_logo" />
|
||||||
|
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_below="@id/Sticker_logo"
|
||||||
|
android:layout_centerHorizontal="true"
|
||||||
|
android:layout_marginTop="15dp"
|
||||||
|
android:text="@string/app_name"
|
||||||
|
android:textColor="@color/color_1c1c1c"
|
||||||
|
android:textSize="18sp" />
|
||||||
|
|
||||||
|
<ProgressBar
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_alignParentBottom="true"
|
||||||
|
android:layout_centerHorizontal="true"
|
||||||
|
android:indeterminateTint="@color/color_43CD80"
|
||||||
|
android:layout_marginBottom="80dp" />
|
||||||
|
|
||||||
|
</RelativeLayout>
|
||||||
25
app/src/main/res/layout/activity_main.xml
Normal file
@ -0,0 +1,25 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||||
|
xmlns:tools="http://schemas.android.com/tools"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
tools:context="emoticon.wasticker.app.view.MainActivity">
|
||||||
|
|
||||||
|
<com.google.android.material.tabs.TabLayout
|
||||||
|
android:id="@+id/category_tab"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="48dp"
|
||||||
|
app:tabMode="scrollable"
|
||||||
|
app:tabSelectedTextColor="@color/color_43CD80"
|
||||||
|
app:tabIndicatorColor="@color/color_43CD80"
|
||||||
|
app:layout_constraintTop_toTopOf="parent" />
|
||||||
|
|
||||||
|
<androidx.viewpager.widget.ViewPager
|
||||||
|
android:id="@+id/tab_vp"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="0dp"
|
||||||
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
|
app:layout_constraintTop_toBottomOf="@id/category_tab" />
|
||||||
|
|
||||||
|
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||||
33
app/src/main/res/layout/adapter_home.xml
Normal file
@ -0,0 +1,33 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<androidx.cardview.widget.CardView xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginStart="12dp"
|
||||||
|
android:background="@color/white"
|
||||||
|
android:id="@+id/item_card_view"
|
||||||
|
android:layout_marginTop="12dp"
|
||||||
|
app:cardCornerRadius="6dp">
|
||||||
|
|
||||||
|
<RelativeLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:padding="12dp"
|
||||||
|
android:layout_height="match_parent">
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/name_tv"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="@string/app_name"
|
||||||
|
android:textColor="@color/color_1c1c1c"
|
||||||
|
android:textSize="18sp" />
|
||||||
|
|
||||||
|
<androidx.recyclerview.widget.RecyclerView
|
||||||
|
android:id="@+id/recycler_preview"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginTop="6dp"
|
||||||
|
android:layout_below="@id/name_tv" />
|
||||||
|
</RelativeLayout>
|
||||||
|
|
||||||
|
</androidx.cardview.widget.CardView>
|
||||||
33
app/src/main/res/layout/adapter_home_child.xml
Normal file
@ -0,0 +1,33 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginStart="8dp"
|
||||||
|
android:id="@+id/relayout"
|
||||||
|
android:background="@drawable/circle_home_preview"
|
||||||
|
android:orientation="horizontal"
|
||||||
|
android:padding="2dp">
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:id="@+id/preview_im"
|
||||||
|
android:layout_width="65dp"
|
||||||
|
android:layout_height="65dp"
|
||||||
|
android:layout_centerInParent="true"
|
||||||
|
android:scaleType="fitXY"
|
||||||
|
android:src="@mipmap/ic_launcher" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/preview_count_tv"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_centerInParent="true"
|
||||||
|
android:background="@drawable/preview_count"
|
||||||
|
android:paddingStart="4dp"
|
||||||
|
android:paddingTop="2dp"
|
||||||
|
android:paddingEnd="4dp"
|
||||||
|
android:paddingBottom="2dp"
|
||||||
|
android:text="+1"
|
||||||
|
android:textColor="@color/color_theme"
|
||||||
|
android:textSize="16sp" />
|
||||||
|
|
||||||
|
</RelativeLayout>
|
||||||
48
app/src/main/res/layout/adapter_sticker.xml
Normal file
@ -0,0 +1,48 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:orientation="vertical">
|
||||||
|
|
||||||
|
<RelativeLayout
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginStart="8dp"
|
||||||
|
android:layout_marginBottom="12dp"
|
||||||
|
android:background="@drawable/sticker_background"
|
||||||
|
android:orientation="horizontal"
|
||||||
|
android:padding="3dp">
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:id="@+id/sticker_im"
|
||||||
|
android:layout_width="120dp"
|
||||||
|
android:layout_height="120dp"
|
||||||
|
android:layout_centerInParent="true"
|
||||||
|
android:scaleType="fitXY"
|
||||||
|
android:src="@mipmap/ic_launcher" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/sticker_pos_tv"
|
||||||
|
android:layout_width="22dp"
|
||||||
|
android:layout_height="22dp"
|
||||||
|
android:layout_alignParentTop="true"
|
||||||
|
android:layout_marginStart="2dp"
|
||||||
|
android:layout_marginTop="2dp"
|
||||||
|
android:gravity="center"
|
||||||
|
android:text="30"
|
||||||
|
android:textColor="@color/color_theme"
|
||||||
|
android:textSize="13sp" />
|
||||||
|
|
||||||
|
|
||||||
|
</RelativeLayout>
|
||||||
|
|
||||||
|
|
||||||
|
<View
|
||||||
|
android:id="@+id/spaceView"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="100dp"
|
||||||
|
android:visibility="gone" />
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
17
app/src/main/res/layout/fragment_home.xml
Normal file
@ -0,0 +1,17 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
xmlns:tools="http://schemas.android.com/tools"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:background="@color/color_FFE4E1"
|
||||||
|
tools:context="emoticon.wasticker.app.view.HomeFragment">
|
||||||
|
|
||||||
|
|
||||||
|
<androidx.recyclerview.widget.RecyclerView
|
||||||
|
android:id="@+id/recycler_list"
|
||||||
|
android:paddingEnd="12dp"
|
||||||
|
android:paddingBottom="12dp"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent" />
|
||||||
|
|
||||||
|
</FrameLayout>
|
||||||
6
app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
|
||||||
|
<background android:drawable="@drawable/ic_launcher_background" />
|
||||||
|
<foreground android:drawable="@drawable/ic_launcher_foreground" />
|
||||||
|
<monochrome android:drawable="@drawable/ic_launcher_foreground" />
|
||||||
|
</adaptive-icon>
|
||||||
6
app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
|
||||||
|
<background android:drawable="@drawable/ic_launcher_background" />
|
||||||
|
<foreground android:drawable="@drawable/ic_launcher_foreground" />
|
||||||
|
<monochrome android:drawable="@drawable/ic_launcher_foreground" />
|
||||||
|
</adaptive-icon>
|
||||||
BIN
app/src/main/res/mipmap-hdpi/ic_launcher.webp
Normal file
|
After Width: | Height: | Size: 1.4 KiB |
BIN
app/src/main/res/mipmap-hdpi/ic_launcher_round.webp
Normal file
|
After Width: | Height: | Size: 2.8 KiB |
BIN
app/src/main/res/mipmap-mdpi/ic_launcher.webp
Normal file
|
After Width: | Height: | Size: 982 B |
BIN
app/src/main/res/mipmap-mdpi/ic_launcher_round.webp
Normal file
|
After Width: | Height: | Size: 1.7 KiB |
BIN
app/src/main/res/mipmap-xhdpi/ic_launcher.webp
Normal file
|
After Width: | Height: | Size: 1.9 KiB |
BIN
app/src/main/res/mipmap-xhdpi/ic_launcher_round.webp
Normal file
|
After Width: | Height: | Size: 3.8 KiB |
BIN
app/src/main/res/mipmap-xxhdpi/ic_launcher.webp
Normal file
|
After Width: | Height: | Size: 2.8 KiB |
BIN
app/src/main/res/mipmap-xxhdpi/ic_launcher_round.webp
Normal file
|
After Width: | Height: | Size: 5.8 KiB |
BIN
app/src/main/res/mipmap-xxxhdpi/ic_launcher.webp
Normal file
|
After Width: | Height: | Size: 3.8 KiB |
BIN
app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.webp
Normal file
|
After Width: | Height: | Size: 7.6 KiB |
BIN
app/src/main/res/mipmap-xxxhdpi/icon_back.png
Normal file
|
After Width: | Height: | Size: 1.1 KiB |
BIN
app/src/main/res/mipmap-xxxhdpi/sticker_logo.png
Normal file
|
After Width: | Height: | Size: 190 KiB |
16
app/src/main/res/values-night/themes.xml
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
<resources xmlns:tools="http://schemas.android.com/tools">
|
||||||
|
<!-- Base application theme. -->
|
||||||
|
<style name="Theme.StickerApplication" parent="Theme.MaterialComponents.DayNight.NoActionBar">
|
||||||
|
<!-- Primary brand color. -->
|
||||||
|
<item name="colorPrimary">@color/purple_200</item>
|
||||||
|
<item name="colorPrimaryVariant">@color/purple_700</item>
|
||||||
|
<item name="colorOnPrimary">@color/black</item>
|
||||||
|
<!-- Secondary brand color. -->
|
||||||
|
<item name="colorSecondary">@color/teal_200</item>
|
||||||
|
<item name="colorSecondaryVariant">@color/teal_200</item>
|
||||||
|
<item name="colorOnSecondary">@color/black</item>
|
||||||
|
<!-- Status bar color. -->
|
||||||
|
<item name="android:statusBarColor">@color/color_FFE4E1</item>
|
||||||
|
<!-- Customize your theme here. -->
|
||||||
|
</style>
|
||||||
|
</resources>
|
||||||
17
app/src/main/res/values/colors.xml
Normal file
@ -0,0 +1,17 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<resources>
|
||||||
|
<color name="purple_200">#FFBB86FC</color>
|
||||||
|
<color name="purple_500">#FF6200EE</color>
|
||||||
|
<color name="purple_700">#FF3700B3</color>
|
||||||
|
<color name="teal_200">#FF03DAC5</color>
|
||||||
|
<color name="teal_700">#FF018786</color>
|
||||||
|
<color name="black">#FF000000</color>
|
||||||
|
<color name="white">#FFFFFFFF</color>
|
||||||
|
<color name="color_1c1c1c">#1C1C1C</color>
|
||||||
|
<color name="color_BFEFFF">#80BFEFFF</color>
|
||||||
|
<color name="color_FFE4E1">#FFE4E1</color>
|
||||||
|
<color name="color_4DFFFFFF">#80FFFFFF</color>
|
||||||
|
|
||||||
|
<color name="color_theme">#FF018786</color>
|
||||||
|
<color name="color_43CD80">#43CD80</color>
|
||||||
|
</resources>
|
||||||
7
app/src/main/res/values/strings.xml
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
<resources>
|
||||||
|
<string name="app_name">Emoticon Stickers</string>
|
||||||
|
|
||||||
|
<string name="add_whatsapp">ADD TO WHATSAPP</string>
|
||||||
|
<string name="match_type_sticker">vnd.android.cursor.dir/vnd.%1$s.%2$s</string>
|
||||||
|
<string name="add_fail">Failed to add, whatsapp was not found</string>
|
||||||
|
</resources>
|
||||||
16
app/src/main/res/values/themes.xml
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
<resources xmlns:tools="http://schemas.android.com/tools">
|
||||||
|
<!-- Base application theme. -->
|
||||||
|
<style name="Theme.StickerApplication" parent="Theme.MaterialComponents.DayNight.NoActionBar">
|
||||||
|
<!-- Primary brand color. -->
|
||||||
|
<item name="colorPrimary">@color/purple_500</item>
|
||||||
|
<item name="colorPrimaryVariant">@color/purple_700</item>
|
||||||
|
<item name="colorOnPrimary">@color/white</item>
|
||||||
|
<!-- Secondary brand color. -->
|
||||||
|
<item name="colorSecondary">@color/teal_200</item>
|
||||||
|
<item name="colorSecondaryVariant">@color/teal_700</item>
|
||||||
|
<item name="colorOnSecondary">@color/black</item>
|
||||||
|
<!-- Status bar color. -->
|
||||||
|
<item name="android:statusBarColor">@color/color_FFE4E1</item>
|
||||||
|
<!-- Customize your theme here. -->
|
||||||
|
</style>
|
||||||
|
</resources>
|
||||||
13
app/src/main/res/xml/backup_rules.xml
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?><!--
|
||||||
|
Sample backup rules file; uncomment and customize as necessary.
|
||||||
|
See https://developer.android.com/guide/topics/data/autobackup
|
||||||
|
for details.
|
||||||
|
Note: This file is ignored for devices older that API 31
|
||||||
|
See https://developer.android.com/about/versions/12/backup-restore
|
||||||
|
-->
|
||||||
|
<full-backup-content>
|
||||||
|
<!--
|
||||||
|
<include domain="sharedpref" path="."/>
|
||||||
|
<exclude domain="sharedpref" path="device.xml"/>
|
||||||
|
-->
|
||||||
|
</full-backup-content>
|
||||||
19
app/src/main/res/xml/data_extraction_rules.xml
Normal file
@ -0,0 +1,19 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?><!--
|
||||||
|
Sample data extraction rules file; uncomment and customize as necessary.
|
||||||
|
See https://developer.android.com/about/versions/12/backup-restore#xml-changes
|
||||||
|
for details.
|
||||||
|
-->
|
||||||
|
<data-extraction-rules>
|
||||||
|
<cloud-backup>
|
||||||
|
<!-- TODO: Use <include> and <exclude> to control what is backed up.
|
||||||
|
<include .../>
|
||||||
|
<exclude .../>
|
||||||
|
-->
|
||||||
|
</cloud-backup>
|
||||||
|
<!--
|
||||||
|
<device-transfer>
|
||||||
|
<include .../>
|
||||||
|
<exclude .../>
|
||||||
|
</device-transfer>
|
||||||
|
-->
|
||||||
|
</data-extraction-rules>
|
||||||
@ -0,0 +1,17 @@
|
|||||||
|
package emoticon.wasticker.app;
|
||||||
|
|
||||||
|
import org.junit.Test;
|
||||||
|
|
||||||
|
import static org.junit.Assert.*;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Example local unit test, which will execute on the development machine (host).
|
||||||
|
*
|
||||||
|
* @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
|
||||||
|
*/
|
||||||
|
public class ExampleUnitTest {
|
||||||
|
@Test
|
||||||
|
public void addition_isCorrect() {
|
||||||
|
assertEquals(4, 2 + 2);
|
||||||
|
}
|
||||||
|
}
|
||||||
BIN
app/testStickerApp.jks
Normal file
11
build.gradle.kts
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
// Top-level build file where you can add configuration options common to all sub-projects/modules.
|
||||||
|
plugins {
|
||||||
|
id("com.android.application") version "8.1.3" apply false
|
||||||
|
id("com.google.gms.google-services") version "4.3.15" apply false
|
||||||
|
id ("com.google.firebase.crashlytics") version "2.9.2" apply false
|
||||||
|
}
|
||||||
|
buildscript{
|
||||||
|
dependencies{
|
||||||
|
classpath("com.applovin.quality:AppLovinQualityServiceGradlePlugin:+")
|
||||||
|
}
|
||||||
|
}
|
||||||
21
gradle.properties
Normal file
@ -0,0 +1,21 @@
|
|||||||
|
# Project-wide Gradle settings.
|
||||||
|
# IDE (e.g. Android Studio) users:
|
||||||
|
# Gradle settings configured through the IDE *will override*
|
||||||
|
# any settings specified in this file.
|
||||||
|
# For more details on how to configure your build environment visit
|
||||||
|
# http://www.gradle.org/docs/current/userguide/build_environment.html
|
||||||
|
# Specifies the JVM arguments used for the daemon process.
|
||||||
|
# The setting is particularly useful for tweaking memory settings.
|
||||||
|
org.gradle.jvmargs=-Xmx2048m -Dfile.encoding=UTF-8
|
||||||
|
# When configured, Gradle will run in incubating parallel mode.
|
||||||
|
# This option should only be used with decoupled projects. More details, visit
|
||||||
|
# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
|
||||||
|
# org.gradle.parallel=true
|
||||||
|
# AndroidX package structure to make it clearer which packages are bundled with the
|
||||||
|
# Android operating system, and which are packaged with your app's APK
|
||||||
|
# https://developer.android.com/topic/libraries/support-library/androidx-rn
|
||||||
|
android.useAndroidX=true
|
||||||
|
# Enables namespacing of each library's R class so that its R class includes only the
|
||||||
|
# resources declared in the library itself and none from the library's dependencies,
|
||||||
|
# thereby reducing the size of the R class for that library
|
||||||
|
android.nonTransitiveRClass=true
|
||||||
BIN
gradle/wrapper/gradle-wrapper.jar
vendored
Normal file
6
gradle/wrapper/gradle-wrapper.properties
vendored
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
#Tue Feb 27 18:22:02 CST 2024
|
||||||
|
distributionBase=GRADLE_USER_HOME
|
||||||
|
distributionPath=wrapper/dists
|
||||||
|
distributionUrl=https\://services.gradle.org/distributions/gradle-8.0-bin.zip
|
||||||
|
zipStoreBase=GRADLE_USER_HOME
|
||||||
|
zipStorePath=wrapper/dists
|
||||||
185
gradlew
vendored
Normal file
@ -0,0 +1,185 @@
|
|||||||
|
#!/usr/bin/env sh
|
||||||
|
|
||||||
|
#
|
||||||
|
# Copyright 2015 the original author or authors.
|
||||||
|
#
|
||||||
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
# you may not use this file except in compliance with the License.
|
||||||
|
# You may obtain a copy of the License at
|
||||||
|
#
|
||||||
|
# https://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
#
|
||||||
|
# Unless required by applicable law or agreed to in writing, software
|
||||||
|
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
# See the License for the specific language governing permissions and
|
||||||
|
# limitations under the License.
|
||||||
|
#
|
||||||
|
|
||||||
|
##############################################################################
|
||||||
|
##
|
||||||
|
## Gradle start up script for UN*X
|
||||||
|
##
|
||||||
|
##############################################################################
|
||||||
|
|
||||||
|
# Attempt to set APP_HOME
|
||||||
|
# Resolve links: $0 may be a link
|
||||||
|
PRG="$0"
|
||||||
|
# Need this for relative symlinks.
|
||||||
|
while [ -h "$PRG" ] ; do
|
||||||
|
ls=`ls -ld "$PRG"`
|
||||||
|
link=`expr "$ls" : '.*-> \(.*\)$'`
|
||||||
|
if expr "$link" : '/.*' > /dev/null; then
|
||||||
|
PRG="$link"
|
||||||
|
else
|
||||||
|
PRG=`dirname "$PRG"`"/$link"
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
SAVED="`pwd`"
|
||||||
|
cd "`dirname \"$PRG\"`/" >/dev/null
|
||||||
|
APP_HOME="`pwd -P`"
|
||||||
|
cd "$SAVED" >/dev/null
|
||||||
|
|
||||||
|
APP_NAME="Gradle"
|
||||||
|
APP_BASE_NAME=`basename "$0"`
|
||||||
|
|
||||||
|
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
|
||||||
|
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
|
||||||
|
|
||||||
|
# Use the maximum available, or set MAX_FD != -1 to use that value.
|
||||||
|
MAX_FD="maximum"
|
||||||
|
|
||||||
|
warn () {
|
||||||
|
echo "$*"
|
||||||
|
}
|
||||||
|
|
||||||
|
die () {
|
||||||
|
echo
|
||||||
|
echo "$*"
|
||||||
|
echo
|
||||||
|
exit 1
|
||||||
|
}
|
||||||
|
|
||||||
|
# OS specific support (must be 'true' or 'false').
|
||||||
|
cygwin=false
|
||||||
|
msys=false
|
||||||
|
darwin=false
|
||||||
|
nonstop=false
|
||||||
|
case "`uname`" in
|
||||||
|
CYGWIN* )
|
||||||
|
cygwin=true
|
||||||
|
;;
|
||||||
|
Darwin* )
|
||||||
|
darwin=true
|
||||||
|
;;
|
||||||
|
MINGW* )
|
||||||
|
msys=true
|
||||||
|
;;
|
||||||
|
NONSTOP* )
|
||||||
|
nonstop=true
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
|
||||||
|
|
||||||
|
|
||||||
|
# Determine the Java command to use to start the JVM.
|
||||||
|
if [ -n "$JAVA_HOME" ] ; then
|
||||||
|
if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
|
||||||
|
# IBM's JDK on AIX uses strange locations for the executables
|
||||||
|
JAVACMD="$JAVA_HOME/jre/sh/java"
|
||||||
|
else
|
||||||
|
JAVACMD="$JAVA_HOME/bin/java"
|
||||||
|
fi
|
||||||
|
if [ ! -x "$JAVACMD" ] ; then
|
||||||
|
die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
|
||||||
|
|
||||||
|
Please set the JAVA_HOME variable in your environment to match the
|
||||||
|
location of your Java installation."
|
||||||
|
fi
|
||||||
|
else
|
||||||
|
JAVACMD="java"
|
||||||
|
which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
|
||||||
|
|
||||||
|
Please set the JAVA_HOME variable in your environment to match the
|
||||||
|
location of your Java installation."
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Increase the maximum file descriptors if we can.
|
||||||
|
if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then
|
||||||
|
MAX_FD_LIMIT=`ulimit -H -n`
|
||||||
|
if [ $? -eq 0 ] ; then
|
||||||
|
if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
|
||||||
|
MAX_FD="$MAX_FD_LIMIT"
|
||||||
|
fi
|
||||||
|
ulimit -n $MAX_FD
|
||||||
|
if [ $? -ne 0 ] ; then
|
||||||
|
warn "Could not set maximum file descriptor limit: $MAX_FD"
|
||||||
|
fi
|
||||||
|
else
|
||||||
|
warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT"
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
|
# For Darwin, add options to specify how the application appears in the dock
|
||||||
|
if $darwin; then
|
||||||
|
GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
|
||||||
|
fi
|
||||||
|
|
||||||
|
# For Cygwin or MSYS, switch paths to Windows format before running java
|
||||||
|
if [ "$cygwin" = "true" -o "$msys" = "true" ] ; then
|
||||||
|
APP_HOME=`cygpath --path --mixed "$APP_HOME"`
|
||||||
|
CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
|
||||||
|
|
||||||
|
JAVACMD=`cygpath --unix "$JAVACMD"`
|
||||||
|
|
||||||
|
# We build the pattern for arguments to be converted via cygpath
|
||||||
|
ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
|
||||||
|
SEP=""
|
||||||
|
for dir in $ROOTDIRSRAW ; do
|
||||||
|
ROOTDIRS="$ROOTDIRS$SEP$dir"
|
||||||
|
SEP="|"
|
||||||
|
done
|
||||||
|
OURCYGPATTERN="(^($ROOTDIRS))"
|
||||||
|
# Add a user-defined pattern to the cygpath arguments
|
||||||
|
if [ "$GRADLE_CYGPATTERN" != "" ] ; then
|
||||||
|
OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)"
|
||||||
|
fi
|
||||||
|
# Now convert the arguments - kludge to limit ourselves to /bin/sh
|
||||||
|
i=0
|
||||||
|
for arg in "$@" ; do
|
||||||
|
CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -`
|
||||||
|
CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option
|
||||||
|
|
||||||
|
if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition
|
||||||
|
eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"`
|
||||||
|
else
|
||||||
|
eval `echo args$i`="\"$arg\""
|
||||||
|
fi
|
||||||
|
i=`expr $i + 1`
|
||||||
|
done
|
||||||
|
case $i in
|
||||||
|
0) set -- ;;
|
||||||
|
1) set -- "$args0" ;;
|
||||||
|
2) set -- "$args0" "$args1" ;;
|
||||||
|
3) set -- "$args0" "$args1" "$args2" ;;
|
||||||
|
4) set -- "$args0" "$args1" "$args2" "$args3" ;;
|
||||||
|
5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
|
||||||
|
6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
|
||||||
|
7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
|
||||||
|
8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
|
||||||
|
9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
|
||||||
|
esac
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Escape application args
|
||||||
|
save () {
|
||||||
|
for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done
|
||||||
|
echo " "
|
||||||
|
}
|
||||||
|
APP_ARGS=`save "$@"`
|
||||||
|
|
||||||
|
# Collect all arguments for the java command, following the shell quoting and substitution rules
|
||||||
|
eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS"
|
||||||
|
|
||||||
|
exec "$JAVACMD" "$@"
|
||||||
89
gradlew.bat
vendored
Normal file
@ -0,0 +1,89 @@
|
|||||||
|
@rem
|
||||||
|
@rem Copyright 2015 the original author or authors.
|
||||||
|
@rem
|
||||||
|
@rem Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
@rem you may not use this file except in compliance with the License.
|
||||||
|
@rem You may obtain a copy of the License at
|
||||||
|
@rem
|
||||||
|
@rem https://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
@rem
|
||||||
|
@rem Unless required by applicable law or agreed to in writing, software
|
||||||
|
@rem distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
@rem See the License for the specific language governing permissions and
|
||||||
|
@rem limitations under the License.
|
||||||
|
@rem
|
||||||
|
|
||||||
|
@if "%DEBUG%" == "" @echo off
|
||||||
|
@rem ##########################################################################
|
||||||
|
@rem
|
||||||
|
@rem Gradle startup script for Windows
|
||||||
|
@rem
|
||||||
|
@rem ##########################################################################
|
||||||
|
|
||||||
|
@rem Set local scope for the variables with windows NT shell
|
||||||
|
if "%OS%"=="Windows_NT" setlocal
|
||||||
|
|
||||||
|
set DIRNAME=%~dp0
|
||||||
|
if "%DIRNAME%" == "" set DIRNAME=.
|
||||||
|
set APP_BASE_NAME=%~n0
|
||||||
|
set APP_HOME=%DIRNAME%
|
||||||
|
|
||||||
|
@rem Resolve any "." and ".." in APP_HOME to make it shorter.
|
||||||
|
for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi
|
||||||
|
|
||||||
|
@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
|
||||||
|
set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m"
|
||||||
|
|
||||||
|
@rem Find java.exe
|
||||||
|
if defined JAVA_HOME goto findJavaFromJavaHome
|
||||||
|
|
||||||
|
set JAVA_EXE=java.exe
|
||||||
|
%JAVA_EXE% -version >NUL 2>&1
|
||||||
|
if "%ERRORLEVEL%" == "0" goto execute
|
||||||
|
|
||||||
|
echo.
|
||||||
|
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
|
||||||
|
echo.
|
||||||
|
echo Please set the JAVA_HOME variable in your environment to match the
|
||||||
|
echo location of your Java installation.
|
||||||
|
|
||||||
|
goto fail
|
||||||
|
|
||||||
|
:findJavaFromJavaHome
|
||||||
|
set JAVA_HOME=%JAVA_HOME:"=%
|
||||||
|
set JAVA_EXE=%JAVA_HOME%/bin/java.exe
|
||||||
|
|
||||||
|
if exist "%JAVA_EXE%" goto execute
|
||||||
|
|
||||||
|
echo.
|
||||||
|
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
|
||||||
|
echo.
|
||||||
|
echo Please set the JAVA_HOME variable in your environment to match the
|
||||||
|
echo location of your Java installation.
|
||||||
|
|
||||||
|
goto fail
|
||||||
|
|
||||||
|
:execute
|
||||||
|
@rem Setup the command line
|
||||||
|
|
||||||
|
set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
|
||||||
|
|
||||||
|
|
||||||
|
@rem Execute Gradle
|
||||||
|
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %*
|
||||||
|
|
||||||
|
:end
|
||||||
|
@rem End local scope for the variables with windows NT shell
|
||||||
|
if "%ERRORLEVEL%"=="0" goto mainEnd
|
||||||
|
|
||||||
|
:fail
|
||||||
|
rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
|
||||||
|
rem the _cmd.exe /c_ return code!
|
||||||
|
if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
|
||||||
|
exit /b 1
|
||||||
|
|
||||||
|
:mainEnd
|
||||||
|
if "%OS%"=="Windows_NT" endlocal
|
||||||
|
|
||||||
|
:omega
|
||||||
20
settings.gradle.kts
Normal file
@ -0,0 +1,20 @@
|
|||||||
|
pluginManagement {
|
||||||
|
repositories {
|
||||||
|
google()
|
||||||
|
mavenCentral()
|
||||||
|
gradlePluginPortal()
|
||||||
|
maven{url = uri("https://artifacts.applovin.com/android")}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
dependencyResolutionManagement {
|
||||||
|
repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
|
||||||
|
repositories {
|
||||||
|
google()
|
||||||
|
mavenCentral()
|
||||||
|
maven ("https://artifact.bytedance.com/repository/pangle")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
rootProject.name = "Emoticon Stickers"
|
||||||
|
include(":app")
|
||||||
|
|
||||||