Android Drag-Drop Button - A custom component for android developers

See on Github

This is an open source android drag button custom component. You can use it on your project to show a drag-able icon and perform any action after user dragged to the edge of the component.

drag drop button screenshot
screenshot

Import aar file on releases directory to your android project to include drag-drop button. Or you can download entire project and open from Android studio and compile to match with your sdk version, then you can import generated aar file to your real project.

Example usage of the drag-drop-button

This is a sample code for drag button inserting into ui and handling events.

xml code to put drag-drop button on the activity
<com.mili.dragdropbutton.DragButton
    android:id="@+id/dragBtn"
    android:layout_width="200dp"
    android:layout_height="200dp"
    custom:imageBtnSizePercentage="0.25"
    custom:dragEndThresholdPercentage="0.10"
    custom:arrowCount="4"
    custom:arrowColor="#42f46e"
    custom:iconFileName="icon2.png">
</com.mili.dragdropbutton.DragButton>

Note:
Needs to define custom namespace on parent tag as
xmlns:custom="http://schemas.android.com/apk/res-auto"

See activity_main.xml on test project for complete source code.


Java code to handle events
DragButton dragButton = (DragButton) findViewById(R.id.dragBtn);
dragButton.setOnDraggedListener(new DragButton.OnDraggedListener() {
    @Override    public void onDragged(DragButton view, MotionEvent e) {
        Log.i("DragBtn", "Dragged");
    }
});
dragButton.setOnDragStartedListener(new DragButton.OnDragStartedListener() {
    @Override    public void onDragStarted(DragButton view, MotionEvent e) {        
        Log.i("DragBtn", "Drag started");
    }
});
dragButton.setOnDragEndedListener(new DragButton.OnDragEndedListener() {
    @Override    public void onDragEnded(DragButton view, MotionEvent e) {
        Log.i("DragBtn", "Drag ended");
    }
});
See MainActivity.java on test project for complete source code.


Custom Attributes on xml

imageBtnSizePercentage
Size of the center icon to draw related to the size of the button. Example- 1 will draw the center icon on entire button, 0.5 will draw half of the size of the button. Any value between 0-1.

dragEndThresholdPercentage
Indicate the percentage area of the threshold to fire the dragged event. Any value between 0-1.


arrowCount
Number of arrow to show the drag direction. Any positive integer value

arrowColor
Color of the arrows in hex format. Example- #42f46e

iconFileName
Path to the image file for center icon on assert folder. 512x512 is the recommended size. 
Example- icon2.png
 
Continue Reading...

How to install Adobe Flash Player plug-in for Firefox on Ubuntu

Click here to check flash player on your browser

Adobe flash player is also a plug-in for for Mozilla Firefox to view flash videos (ex: youtube videos) and play flash on-line games, etc. Therefore flash player became essential plug-in for most of the web browsers until HTML 5 take place (because HTML 5 has new capabilities those can challenge to flash player such as video playing).

This article describe how to install Adobe Flash Player plug-in for Firefox on Ubuntu

You might be think, is this a very harder thing?

Yes, some times.

Because, Ubuntu software center and Synaptic package manager can use to install flash player plug-in for some Ubuntu versions and it will simply works. But some Ubuntu distribution such as Ubuntu 16.04 needs to follow following few steps to make it work correctly.

Step 1- Download latest Adobe Flash Player Plug-in form here.(Select download option as 'tar.gz for other Linux')

Step 2- Extract downloaded file into any directory. (extracted file should be .so format)

Step 3- Open terminal (Application --> Accessories --> Terminal or Ctrl+Alt+T)

Step 4- Type following command

sudo -i

Now it will prompt you the Password. Now enter the password and press enter  

Step 5- Goto directory that contain extracted .so file using cd command (Ex: cd Downlods)

Step 6- Copy that .so file into /usr/lib/mozilla/plugins directory. To copy that file use following command.

cp [fileName].so /usr/lib/firefox-addons/plugins

(Ex: cp libflashplayer.so /usr/lib/firefox-addons/plugins)

Step 7- Restart the system to make changes appear to Firefox.

It is better to close all the Firefox related windows before copy the .so file. Remember you should restart the system to make plug-in work correctly (Not only restart Firefox)

If this article helpful to some one please do not forget to comment about it.

See how to do this from videos!


Continue Reading...

Is flash player installed?

This page allows you to check whether your browser has flash player installed.
and detect the installed flash player version.
The check perfectly works on Firefox and Chrome.
Check how you can install flash, if it says NO!
Click here to read how to install, or watch following videos. Adobe flash player is also a plug-in for for Mozilla Firefox to view flash videos (ex: youtube videos) and play flash on-line games, etc. Therefore flash player became essential plug-in for most of the web browsers until HTML 5 take place (because HTML 5 has new capabilities those can challenge to flash player such as video playing). This article describe how to install Adobe Flash Player plug-in for Firefox on Ubuntu

YES!
Congratulations! Flash player has installed
NO!
Flash player has not installed or blocked by browser


This page allows you to check whether your browser has flash player installed. and detect the installed flash player version. The check perfectly works on Firefox and Chrome.

Check how you can install flash, if it says NO!


Click here to read how to install, or watch following videos





This page is using JavaScript Flash Detection Library (Flash Detect) by Carl S. Yestrau. So thanks for creating such a nice library!
Continue Reading...