Material Design Hub

Showing posts with label Android Tutorial. Show all posts
Showing posts with label Android Tutorial. Show all posts

Tuesday, July 28, 2015

CircleView Android Library

CircleView Android Library



CircleView Android Library

Description:-   An circle view, similar to Android's ProgressBar. Can be used in 'value mode' or 'spinning mode'.

Min SDK: 14 (Android 4.0–4.0.2 Ice Cream Sandwich).

Contributors:  https://github.com/jakob-grabner



How To Use CircleView Android Library:  

- Download the CircleProgressView.aar into your libs folder.
- Add libs folder as a maven repo in your build.gradle

repositories {
    mavenCentral()
    flatDir {
        dirs 'libs' //this way we can find the .aar file in libs folder
    }
}

- add dependency
compile 'at.grabner.circleprogress:CircleProgressView:1.0@aar'


 Add CircleView to your layout:

<at.grabner.circleprogress.CircleProgressView
   android:layout_width="277dp"
   android:layout_height="wrap_content"
   android:id="@+id/circleView"
   CircleProgressView:rimWidth="35dp"
   CircleProgressView:barWidth="35dp"
   CircleProgressView:contourSize="0dp"
   CircleProgressView:unitColor="@color/primary_color"/>


 Add CircleView in your JAVA code:

mCircleView = (CircleProgressView) findViewById(R.id.circleView);
        mCircleView.setMaxValue(100);
        mCircleView.setUnit("%");
        mCircleView.setValue(0);


Please Join our Facebook  Group and Page

Facebook group: Android controls

Facebook page: Android Controls

Subscribe YouTube channel: Click here

SUBSCRIBE TO OUR EMAIL NEWSLETTER & RECEIVE UPDATES RIGHT IN YOUR INBOX.   Click here


If You Have Any question or Suggestions Please Feel Free to Comments .

Monday, June 1, 2015

AndroidImageSlider Android Library

AndroidImageSlider Android Library

AndroidImageSlider Android Library

Description:-  This is an amazing image slider for the Android platform. I decided to open source this because there is really not an attractive, convenient slider widget in Android.

You can easily load images from an internet URL, drawable, or file. And there are many kinds of amazing animations you can choose. :-D

Min SDK: 8 (Android 2.2–2.2.3 Froyo).

Contributors: https://github.com/daimajia/AndroidImageSlider/graphs/contributors


How to use AndroidImageSlider Android Library in eclipse :-

Step 1: Create a new Android Project

Step 2: Import  Library to your Android Application Project
     1: File->New->Other
     2: Select Android Project
     3: Select "Create Project from existing source"
     4: Click "Browse and select AndroidImageSlider Android Library, 
     5: Finish 
     6: Right-click on your project -> Properties
     7: In Android->Library section click Add
     8: select recently added project -> Ok
     9: that's it!

Gradle:
dependencies {
        compile "com.android.support:support-v4:+"
        compile 'com.squareup.picasso:picasso:2.3.2'
        compile 'com.nineoldandroids:library:2.4.0'
        compile 'com.daimajia.slider:library:1.1.5@aar'
}

Maven:
<dependency>
    <groupId>com.squareup.picasso</groupId>
    <artifactId>picasso</artifactId>
    <version>2.3.2</version>
</dependency>
<dependency>
    <groupId>com.nineoldandroids</groupId>
    <artifactId>library</artifactId>
    <version>2.4.0</version>
</dependency>
<dependency>
    <groupId>com.daimajia.slider</groupId>
    <artifactId>library</artifactId>
    <version>1.1.2</version>
    <type>apklib</type>
</dependency>

How To Use AndroidImageSlider Android Library:  

Add permissions (if necessary) to your AndroidManifest.xml
<!-- if you want to load images from the internet -->
<uses-permission android:name="android.permission.INTERNET" /> 

<!-- if you want to load images from a file OR from the internet -->
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
Note: If you want to load images from the internet, you need both the INTERNET and READ_EXTERNAL_STORAGE permissions to allow files from the internet to be cached into local storage.
If you want to load images from drawable, then no additional permissions are necessary.

Step 3

Add the Slider to your layout:
<com.daimajia.slider.library.SliderLayout
        android:id="@+id/slider"
        android:layout_width="match_parent"
        android:layout_height="200dp"
/>
There are some default indicators. If you want to use a provided indicator:
<com.daimajia.slider.library.Indicators.PagerIndicator
        android:id="@+id/custom_indicator"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:gravity="center"
        />
Please Join our Facebook  Group and Page

Facebook group: Android controls

Facebook page: Android Controls

Subscribe YouTube channel: Click here

SUBSCRIBE TO OUR EMAIL NEWSLETTER & RECEIVE UPDATES RIGHT IN YOUR INBOX.   Click here


If You Have Any question or Suggestions Please Feel Free to Comments .


Sunday, May 31, 2015

ElasticDownload Android Library

ElasticDownload Android Library

ElasticDownload Android Library

ElasticDownload Android Library

Description:- This Library provide a downloading animation(custom view, playing with canvas rotation and path drawing).

Min SDK: 8 (Android 2.2–2.2.3 Froyo).

Contributors: https://github.com/Tibolte/ElasticDownload/graphs/contributors


How to use ElasticDownload Android Library in eclipse :-

Step 1: Create a new Android Project

Step 2: Import  Library to your Android Application Project
     1: File->New->Other
     2: Select Android Project
     3: Select "Create Project from existing source"
     4: Click "Browse and select ElasticDownload Android Library, 
     5: Finish 
     6: Right-click on your project -> Properties
     7: In Android->Library section click Add
     8: select recently added project -> Ok
     9: that's it!

How To Use LolliPin Android Library :  

Declare this view in your layout like below, it's also possible to inflate it manually.
    <is.arontibo.library.ElasticDownloadView
        android:id="@+id/elastic_download_view"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_centerInParent="true"/>
At first, call startIntro() to make the view be able to display any percentage:
    @InjectView(R.id.elastic_download_view) ElasticDownloadView mElasticDownloadView;

    mElasticDownloadView.startIntro();
Set any progress:
    mElasticDownloadView.setProgress(25);
Notify if the download has failed or not:
    mElasticDownloadView.success(); //This function moves the cursor to 100 if the progress has not been set already

    mElasticDownloadView.fail();

Please Join our Facebook  Group and Page

Facebook group: Android controls

Facebook page: Android Controls

Subscribe YouTube channel: Click here

SUBSCRIBE TO OUR EMAIL NEWSLETTER & RECEIVE UPDATES RIGHT IN YOUR INBOX.   Click here


If You Have Any question or Suggestions Please Feel Free to Comments .

Saturday, May 30, 2015

LolliPin Android Library

 LolliPin Android Library



Description:- This Library provide a  a Lollipop material design styled android pincode library (API 10+).

Min SDK: 10 (Android 2.3.3–2.3.7 Gingerbread).



How to use LolliPin Android Libraryin eclipse :-

Step 1: Create a new Android Project

Step 2: Import  Library to your Android Application Project
     1: File->New->Other
     2: Select Android Project
     3: Select "Create Project from existing source"
     4: Click "Browse and select LolliPin Android Library, 
     5: Finish 
     6: Right-click on your project -> Properties
     7: In Android->Library section click Add
     8: select recently added project -> Ok
     9: that's it!

Gradle(Android studio):

   //Lollipin
   compile 'com.github.orangegangsters:lollipin:1.2.2@aar'
How To Use LolliPin Android Library : In order to use the "Forgot" system, we let you extend the AppLockActivity class to provide your own way of handling the user behaviour in this case (logout, delete datas etc...)
public class CustomPinActivity extends AppLockActivity {
    @Override
    public void showForgotDialog() {
        //Launch your popup or anything you want here
    }
}

Init

Advised to be done by extending the Application, but can be done elsewhere. The method below provides a way to enable or disable the PinCode system:
Enabling
LockManager<CustomPinActivity> lockManager = LockManager.getInstance();
lockManager.enableAppLock(this, CustomPinActivity.class);
Once enabled, you must extend "PinActivity" for every Activity you wish to protect.
Disabling
LockManager<CustomPinActivity> lockManager = LockManager.getInstance();
lockManager.disableAppLock();

Set up the PinCode

Whenever you want the user to set up his pin code, you need to request:
Intent intent = new Intent(MainActivity.this, CustomPinActivity.class);
intent.putExtra(AppLock.EXTRA_TYPE, AppLock.ENABLE_PINLOCK);
startActivityForResult(intent, REQUEST_CODE_ENABLE);

Unlock system

As soon as you enable the PinCode system, the Unlock screen will appear by itself when the user resume the app after a defined timeout. Please refer to the next section to know how to customize these values.

Customization

Some features are customizable:

The unlock timeout:

LockManager<CustomPinActivity> lockManager = LockManager.getInstance();
lockManager.getAppLock().setTimeout(10000);

The logo displayed at the top of the page:

LockManager<CustomPinActivity> lockManager = LockManager.getInstance();
lockManager.getAppLock().setLogoId(R.drawable.security_lock);

The ignored activities: For instance you got a login activity that you want to avoid getting the lock screen, you can ignore this activity by doing:

LockManager<CustomPinActivity> lockManager = LockManager.getInstance();
lockManager.getAppLock().addIgnoredActivity(NotLockedActivity.class);

The AppLockActivity Layout: By providing a custom layout to getContentView() you can alter how your AppLockActivity looks. However, you must include 4 required elements:

  • TextView with an id of pin_code_step_textview
  • TextView with an id of pin_code_forgot_textview
  • PinCodeRoundView with an id of pin_code_round_view
  • KeyboardView with an id of pin_code_keyboard_view
@Override
    public int getContentView() {
        return R.layout.activity_pin;
    }

The Pin Dots: By supplying alternate drawable resources for app:lp_empty_pin_dot and app:lp_full_pin_dot you can custimize how it looks.

<com.github.orangegangsters.lollipin.lib.views.PinCodeRoundView
                android:id="@+id/pin_code_round_view"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_marginTop="@dimen/pin_code_round_top_margin"
                android:layout_marginBottom="@dimen/pin_code_elements_margin"
                app:lp_empty_pin_dot="@drawable/pin_empty_dot"
                app:lp_full_pin_dot="@drawable/pin_full_dot"/>

Please Join our Facebook  Group and Page

Facebook group: Android controls

Facebook page: Android Controls

Subscribe YouTube channel: Click here

SUBSCRIBE TO OUR EMAIL NEWSLETTER & RECEIVE UPDATES RIGHT IN YOUR INBOX.   Click here


If You Have Any question or Suggestions Please Feel Free to Comments .

Android Confirm Dialog Library

Android Confirm Dialog Library


Android Confirm Dialog Library

Description:- This Library provide a  custom animated Android confirm dialog.

Min SDK: 9 (Android 2.3–2.3.2 Gingerbread).


How to use  Confirm Dialog Android Library in eclipse :-

Step 1: Create a new Android Project

Step 2: Import  Library to your Android Application Project
     1: File->New->Other
     2: Select Android Project
     3: Select "Create Project from existing source"
     4: Click "Browse and select  Confirm Dialog Android Library, 
     5: Finish 
     6: Right-click on your project -> Properties
     7: In Android->Library section click Add
     8: select recently added project -> Ok
     9: that's it!

Download via maven:


<dependency>
    <groupId>com.github.vignesh-iopex</groupId>
    <artifactId>confirmdialog</artifactId>
    <version>1.0</version>
</dependency>

or Gradle(Android studio):


compile 'com.github.vignesh-iopex:confirmdialog:1.0'

How To Use Confirm Dialog  Library :
public class MainActivity extends Activity {
  @Override protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    Confirm.using(this).ask("Fire missles?").onPositive("Yes", new DialogEventListener.OnClickListener() {
                           @Override public void onClick(DialogEventListener dialog, int which) {
                             launchMissles();
                           }}).onNegative("No",  new DialogEventListener.OnClickListener() {
                           @Override public void onClick(DialogEventListener dialog, int which) {
                             sendFalseAlarm();
                           }}).build().show();
  }
}

Please Join our Facebook  Group and Page

Facebook group: Android controls

Facebook page: Android Controls

Subscribe YouTube channel: Click here

SUBSCRIBE TO OUR EMAIL NEWSLETTER & RECEIVE UPDATES RIGHT IN YOUR INBOX.   Click here


If You Have Any question or Suggestions Please Feel Free to Comments .

Thursday, May 28, 2015

Material Animations Android Library

Android Transition animations explanation with examples.

Min SDK:- 16 (Android 4.1 Jelly Bean)

Author:-  https://github.com/lgvalle/Material-Animations/graphs/contributors

Description:- 
Android Transitions
android Transition Framework can be used for three main things:

1: Animate View elements in transitions between activites (or fragments)
2: Animate shared elements (hero views) in transitions between activities (or fragments)
Animate View elements from one activity scene to another.

1. Transitions between Activities


Animate existing activity layout content (non-hero views)
Material Animations Android Library

Click Here for Download Material Animations Android Library

How to use Material Animations Android Library in eclipse :-

Step 1: Create a new Android Project

Step 2: Import  Library to your Android Application Project
     1: File->New->Other
     2: Select Android Project
     3: Select "Create Project from existing source"
     4: Click "Browse and select Material Animations Android Library, 
     5: Finish 
     6: Right-click on your project -> Properties
     7: In Android->Library section click Add
     8: select recently added project -> Ok
     9: that's it!

Declarative:-


res/transition/activity_explode.xml
<?xml version="1.0" encoding="utf-8"?>
<transitionSet xmlns:android="http://schemas.android.com/apk/res/android">
    <explode android:duration="2000"/>
</transitionSet>
res/values/style.xml
<item name="android:windowEnterTransition">@transition/activity_explode.xml</item>
To inflate specific xml defined transition:
MainActivity.java
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        setupWindowAnimations();
    }

    private void setupWindowAnimations() {
        Explode explode = TransitionInflater.from(this).inflateTransition(R.transition.activity_explode);
        explode.setDuration(2000);
        getWindow().setExitTransition(explode);
    }

Programatically

MainActivity.java
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        setupWindowAnimations();
    }

    private void setupWindowAnimations() {
        Explode explode = new Explode();
        explode.setDuration(2000);
        getWindow().setExitTransition(explode);
    }
DetailActivity.java
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        setupWindowAnimations();
    }

    private void setupWindowAnimations() {
        Explode explode = new Explode();
        explode.setDuration(2000);
        getWindow().setEnterTransition(explode);
    }
Material Animations Android Library



Click Here for more details of implementation:

Please Join our Facebook  Group and Page

Facebook group: Android controls

Facebook page: Android Controls

Subscribe YouTube channel: Click here

SUBSCRIBE TO OUR EMAIL NEWSLETTER & RECEIVE UPDATES RIGHT IN YOUR INBOX.   Click here


If You Have Any question or Suggestions Please Feel Free to Comments .

ExpandableView Android Library

ExpandableView : ExpandableView is a View showing only a content and when clicked on it, it displays more content in a fashion way.


ExpandableView Android Library

Description:-  ExpandableView is a View showing only a content and when clicked on it, it displays more content in a fashion way. You can add views or viewgroups but remember that it will only display the content in a LinearLayout with vertical orientation.

You can choose by default a "chevron" icon animation or a "plus" icon animation. The "always visible row" has a left icon, a text and finally a right icon which will be the animated one.

Min SDK:- 14 (Android 4.0–4.0.2 Ice Cream Sandwich)


Chick Here for Download ExpandableView Android Library

Instructions - Maven Central
  1. Add this library in your build.gradle:
dependencies {
    compile 'coming soon...'
}
Instructions:
1: Clone the git repo
2: Import the "ExpandableView" module into your Android-gradle project.
3: Add "ExpandableView" module in your settings.gradle
4: DONE

How to use ExpandableView Android Library in eclipse :-

Step 1: Create a new Android Project

Step 2: Import  Library to your Android Application Project
     1: File->New->Other
     2: Select Android Project
     3: Select "Create Project from existing source"
     4: Click "Browse and select ExpandableView Android Library, 
     5: Finish 
     6: Right-click on your project -> Properties
     7: In Android->Library section click Add
     8: select recently added project -> Ok
     9: that's it!

How to Use it: As any view in Android you can add it by code or by layout xml file but remember that if you want to change the default height of the visible content you need to use:
topExpandableView.setVisibleLayoutHeight(300);
topExpandableView.setVisibleLayoutHeight(getResources().getDimensionPixelSize(R.dimen.new_height));

Remember also to fill the information inside the visible content by using:


expandableView.fillData(R.drawable.ic_android, R.string.android_names, true);
//or
expandableView.fillData(R.drawable.ic_android, getString(R.string.android_names), true);
//or
expandableView.fillData(R.drawable.ic_android, R.string.android_names, true);
//or
expandableView.fillData(R.drawable.ic_android, getString(R.string.android_names));
//or
expandableView.fillData(R.drawable.ic_android, R.string.android_names);

//or
expandableView.fillData(0, R.string.android_names); // No drawable left by passing 0.

If you want to add content into the discoverable LinearLayout simple use:
expandableView.addContentView(itemView); // itemView could be a simple TextView or more complex custom views

The most relevant part of this ExpandableView is when you want to include an ExpandableView into another ExpandableView, you need to pass the parent's View hierarchy, like this:
expandableViewLevel1.setOutsideContentLayout(topExpandableView.getContentLayout()); // 1 Level
expandableViewLevel2.setOutsideContentLayout(topExpandableView.getContentLayout(), expandableViewLevel1.getContentLayout()); // 2 Levels
expandableViewLevel3.setOutsideContentLayout(topExpandableView.getContentLayout(), expandableViewLevel1.getContentLayout(), expandableViewLevel2.getContentLayout()); // 3 Levels

Also remember to use this package in your layout files:
<com.expandable.view.ExpandableView
    android:id="@+id/activity_main_top_expandable_view"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"/>
Please Join our Facebook  Group and Page

Facebook group: Android controls

Facebook page: Android Controls

Subscribe YouTube channel: Click here

SUBSCRIBE TO OUR EMAIL NEWSLETTER & RECEIVE UPDATES RIGHT IN YOUR INBOX.   Click here


If You Have Any question or Suggestions Please Feel Free to Comments .