Showing posts with label Library. Show all posts
Showing posts with label Library. Show all posts

Icon Changer Library






FIRST
1. First make String with name "activeName"

2. Make List String with name "disableName"

get to Oncreate now in MainActivity.java
3. on String activeName set to Active icon By Default e.g "com.ebook.sketchware.MainActivity-default"

4. on List String disableName you can put list disable icon if not chooser e.g "com.ebook.sketchware.MainActivity-java" and "com.ebook.sketchware.MainActivity-black"

5. create new MoreBlok with name setIcon and add String with name "active" and add List String with name "disable"

6. add this code on this blok:


setAppIcon(_active, _disable);
}
public void setAppIcon(String activeName, List disableName) {
new AppIconNameChanger.Builder(MainActivity.this)
.activeName(activeName) // String
.disableNames(disableName) // List
.packageName(getApplicationContext().getPackageName())
.build()
.setNow();
}


public static class AppIconNameChanger {

    private Activity activity;
    List disableNames;
    String activeName;
    String packageName;

    public AppIconNameChanger(Builder builder) {

        this.disableNames = builder.disableNames;
        this.activity = builder.activity;
        this.activeName = builder.activeName;
        this.packageName = builder.packageName;

    }

    public static class Builder {

        private Activity activity;
        List disableNames;
        String activeName;
        String packageName;

        public Builder(Activity activity) {
            this.activity = activity;
        }

        public Builder disableNames(List disableNamesl) {
            this.disableNames = disableNamesl;
            return this;
        }

        public Builder activeName(String activeName) {
            this.activeName = activeName;
            return this;
        }

        public Builder packageName(String packageName) {
            this.packageName = packageName;
            return this;
        }

        public AppIconNameChanger build() {
            return new AppIconNameChanger(this);
        }

    }

    public void setNow() {

        activity.getPackageManager().setComponentEnabledSetting(
                new android.content.ComponentName(packageName, activeName),
                android.content.pm.PackageManager.COMPONENT_ENABLED_STATE_ENABLED, android.content.pm.PackageManager.DONT_KILL_APP);

        for (int i = 0; i < disableNames.size(); i++) {
            try {
                activity.getPackageManager().setComponentEnabledSetting(
                        new android.content.ComponentName(packageName, disableNames.get(i)),
                        android.content.pm.PackageManager.COMPONENT_ENABLED_STATE_DISABLED, android.content.pm.PackageManager.DONT_KILL_APP);
            } catch (Exception e) {
                e.printStackTrace();
            }
        }
    }
}
public void CodeByGabriel() {

save and go to manifest:
7. Find this on manifest
<activity android:configchanges="orientation|screenSize" android:name=".MainActivity" android:theme="@style/FullScreen">
 <intent-filter>
  <action android:name="android.intent.action.MAIN">
  <category android:name="android.intent.category.LAUNCHER">
 </category></action></intent-filter>
</activity>
Remove this tag intent:
<intent-filter>
 <action android:name="android.intent.action.MAIN">
 <category android:name="android.intent.category.LAUNCHER">
</category>
</action>
</intent-filter>

And After tag:
</activity>

You just add Activity Alias:
<activity-alias
            android:enabled="true"
            android:icon="@drawable/app_icon"
            android:label="Java Library"
            android:name="com.ebook.sketchware.MainActivity-default"
            android:targetActivity=".MainActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity-alias>
<activity-alias
            android:enabled="false"
            android:icon="@drawable/icon_java"
            android:label="Java Library"
            android:name="com.ebook.sketchware.MainActivity-java"
            android:targetActivity=".MainActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity-alias>
<activity-alias
            android:enabled="false"
            android:icon="@drawable/icon_black"
            android:label="Java Library"
            android:name="com.ebook.sketchware.MainActivity-black"
            android:targetActivity=".MainActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity-alias>


True = are default icon actived.. you only changr icon location you want.. Done And Tested..

Dot Progress Library



DotProgress Library for android studio mobile like sketchware. This will make loading animation with Dot.
Tested on sketchware. Im convert it to support for sketchware. And this Library for sketchware. See screenshot maked by sketchware:


For ise it like this:

Example:

final DilatingDotsProgressBar bar = new DilatingDotsProgressBar(this);
bar.setLayoutParams(new LinearLayout.LayoutParams(android.widget.LinearLayout.LayoutParams.WRAP_CONTENT, android.widget.LinearLayout.LayoutParams.WRAP_CONTENT));
bar.setDotRadius(5);
bar.setDotColors(Color.RED, Color.BLACK);
bar.setNumberOfDots(3);
bar.setDotScaleMultiplier(1);
bar.setGrowthSpeed(500);
bar.setDotSpacing(4);
linear1.addView(bar);


button1.setOnClickListener(new View.OnClickListener() {
public void onClick(View v) {
bar.showNow();
}
});

button2.setOnClickListener(new View.OnClickListener() {
public void onClick(View v) {
bar.hideNow();
}
});


Download Library:

Download Example app:

BoxLoader Library

BoxLoader Library for android studio mobile like sketchware. This will make loading animation with box. Tested on sketchware. Im convert it to support for sketchware. And this Library for sketchware. See screenshot maked by sketchware:





To use it download first the library and edit it. Put on sketchware with moreblock.
And put this example on onCreate.
Example Code
final BoxLoaderView b = new BoxLoaderView(MainActivity.this);
b.setLayoutParams(new LinearLayout.LayoutParams(200,200));
linear1.addView(b);
b.setSpeed(5);
b.setStrokeColor(Color.parseColor("#995876"));
b.setLoaderColor(Color.parseColor("#C67890"));
b.setStrokeWidth(20);

For library download:
For example app download:

Titanic Library

Titanic Library is animation for TextView. Verry Beautiful and nice for use at sketchware. this code im found at Library Development but im convert it to Standart Library for using at sketchware.
To use this library verry simpe like this. First Add New Library Titanic

final TitanicTextView mytext = new TitanicTextView(MainActivity.this);

Add text to showing Titanic:

mytext.setText("Created By Gabriel");

add size with float:

mytext.setTextSize((float)100);

Add color Black like this:

mytext.setTextColor(0xFF000000);

add layout to titanic:

mytext.setLayoutParams(new LinearLayout.LayoutParams(android.widget.LinearLayout.LayoutParams.WRAP_CONTENT, android.widget.LinearLayout.LayoutParams.WRAP_CONTENT));

add showing titanic at linear1 like this:

linear1.addView(mytext);

if you want showing at position 1, but must sure on linear wass added another content. for this code set with 0 and titanic will show at pos 1, and if set 1 titanic will show at pos 2. like this:

linear1.addView(mytext, 0);

if you want add font add this:

mytext.setTypeface(Typeface.createFromAsset(getAssets(),"fonts/atisfyegular.ttf"), 0);

add button to start animation titanic:

button1.setOnClickListener(new View.OnClickListener() {
public void onClick(View v) {
new Titanic().start(mytext);
}
});

For Example starting only use:

new Titanic().start(mytext);



Download Library At:

Download Demo App At:

MatchTextView Library

MatchTextView is library for java development, this is animation for textview.

Default Library must installed by grandle but this wass converted to class for sketchware.

To use this for sketchware only put code.
Like this:

Example Code
final MatchTextView mMatchTextView = new MatchTextView(MainActivity.this);
mMatchTextView.setText("Your Text");
mMatchTextView.setTextColor("0xFF000000");
mMatchTextView.setLayoutParams(new LinearLayout.LayoutParams(android.widget.LinearLayout.LayoutParams.WRAP_CONTENT, android.widget.LinearLayout.LayoutParams.WRAP_CONTENT));
linear1.addView(mMatchTextView);
mMatchTextView.setProgress((float)100);


To hide this animation only use hide()


If you like see a demo:

If you like library:

Toasty Library Sketchware

Toasty Library Converted By Gabriel
this example notification with custome.
this support for sketchware.





Each method always returns a Toast object, so you can customize the Toast much more.
**DON'T FORGET THE show() METHOD!**


To Use:

To display an error Toast:

Toasty.error(yourContext, "This is an error toast.", Toast.LENGTH_SHORT, true).show();

To display a success Toast:

Toasty.success(yourContext, "Success!", Toast.LENGTH_SHORT, true).show();

To display an info Toast:

Toasty.info(yourContext, "Here is some info for you.", Toast.LENGTH_SHORT, true).show();

To display a warning Toast:

Toasty.warning(yourContext, "Beware of the dog.", Toast.LENGTH_SHORT, true).show();

To display the usual Toast:

Toasty.normal(yourContext, "Normal toast w/o icon").show();

To display the usual Toast with icon:

Toasty.normal(yourContext, "Normal toast w/ icon", yourIconDrawable).show();

You can also create your custom Toasts with the `custom()` method:

Toasty.custom(yourContext, "I'm a custom Toast", yourIconDrawable, tintColor, duration, withIcon, 
shouldTint).show();
Installed Sketchware:
- Upload Image
- Add toast_layout.xml
- Add toast_icon (ImageView) on linear make sure 24x24 and set default.png as default image
- Add toast_text (TextView) on linear

How To Use For sketchware?

# Error Type:

Toasty.error(MainActivity.this, "This is an error toast.", Toast.LENGTH_SHORT, true).show();

# Success Type:

Toasty.success(MainActivity.this, "Success!", Toast.LENGTH_SHORT, true).show();

# Info Type:

Toasty.info(MainActivity.this, "Here is some info for you.", Toast.LENGTH_SHORT, true).show();

# Warning Type:

Toasty.warning(MainActivity.this, "Beware of the dog.", Toast.LENGTH_SHORT, true).show();

# Normal Withouth Icon:

Toasty.normal(MainActivity.this, "Normal toast w/o icon").show();

# Normal With Icon:

android.graphics.drawable.Drawable icon = getResources().getDrawable(R.drawable.ic_pets_white_48dp);
Toasty.normal(MainActivity.this, "Normal toast w/ icon", icon).show();

# Format Type:

Toasty.info(MainActivity.this, getFormattedMessage()).show();

# This Format:

private CharSequence getFormattedMessage() {
        final String prefix = "Formatted ";
        final String highlight = "bold italic";
        final String suffix = " text";
        android.text.SpannableStringBuilder ssb = new android.text.SpannableStringBuilder(prefix).append(highlight).append(suffix);
        int prefixLen = prefix.length();
        ssb.setSpan(new android.text.style.StyleSpan(android.graphics.Typeface.BOLD_ITALIC),
                prefixLen, prefixLen + highlight.length(), android.text.Spannable.SPAN_EXCLUSIVE_EXCLUSIVE);
        return ssb;
    }

# Custome Config

Toasty.Config.getInstance()
 .setTextColor(Color.GREEN)
 .setToastTypeface(Typeface.createFromAsset(getAssets(), "fonts/terminal.ttf"))
 .apply();

Toasty.custom(MainActivity.this, "Converted By Gabriel", getResources().getDrawable(R.drawable.laptop512), Color.BLACK, Toast.LENGTH_SHORT, true, true).show();
Toasty.Config.reset();


Library Toasty Download Here

Demo app make by sketchware Download here