Implement drag-and-drop movable PopupWindow

Posted by Unknown Jumat, 24 Januari 2014 0 komentar
This example implement OnTouchListener() for PopupWindow to detect user action of drag-and-drop, to move PopupWindow.

movable PopupWindow
Movable PopupWindow

package com.example.androidpopupwindow;

import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.MotionEvent;
import android.view.View;
import android.view.View.OnTouchListener;
import android.view.ViewGroup.LayoutParams;
import android.widget.ArrayAdapter;
import android.widget.Button;
import android.widget.PopupWindow;
import android.widget.Spinner;
import android.app.Activity;

public class MainActivity extends Activity {

String[] DayOfWeek = {"Sunday", "Monday", "Tuesday",
"Wednesday", "Thursday", "Friday", "Saturday"};

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

final Button btnOpenPopup = (Button) findViewById(R.id.openpopup);
btnOpenPopup.setOnClickListener(new Button.OnClickListener() {

@Override
public void onClick(View arg0) {
LayoutInflater layoutInflater =
(LayoutInflater)getBaseContext()
.getSystemService(LAYOUT_INFLATER_SERVICE);
View popupView = layoutInflater.inflate(R.layout.popup, null);
final PopupWindow popupWindow = new PopupWindow(
popupView, LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT);

Button btnDismiss = (Button)popupView.findViewById(R.id.dismiss);

Spinner popupSpinner = (Spinner)popupView.findViewById(R.id.popupspinner);

ArrayAdapter<String> adapter =
new ArrayAdapter<String>(MainActivity.this,
android.R.layout.simple_spinner_item, DayOfWeek);
adapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
popupSpinner.setAdapter(adapter);

btnDismiss.setOnClickListener(new Button.OnClickListener(){

@Override
public void onClick(View v) {
popupWindow.dismiss();
}});

popupWindow.showAsDropDown(btnOpenPopup, 50, -30);

popupView.setOnTouchListener(new OnTouchListener() {
int orgX, orgY;
int offsetX, offsetY;

@Override
public boolean onTouch(View v, MotionEvent event) {
switch (event.getAction()) {
case MotionEvent.ACTION_DOWN:
orgX = (int) event.getX();
orgY = (int) event.getY();
break;
case MotionEvent.ACTION_MOVE:
offsetX = (int)event.getRawX() - orgX;
offsetY = (int)event.getRawY() - orgY;
popupWindow.update(offsetX, offsetY, -1, -1, true);
break;
}
return true;
}});
}

});
}

}

For other files, such as layout, customborder.xml...etc, refer to last exercise "PopupWindow with transparent background" and "Create background of Popup Window with custom shape".

download filesDownload the files.



Related: Interactive resizable PopupWindow




Baca Selengkapnya ....

The fastest way to recover deleted photos from Samsung Galaxy Note 3/S4/S3

Posted by Unknown Kamis, 23 Januari 2014 0 komentar

Hello, Samsung Galaxy photo losers!

As the most popular Android gadgets in the wolrd, I think you have known or had Samsung Galaxy phone. And no doubt, Samsung Galalxy Note 3 and Samsung Galaxy are "the most worthy to own" Android phone in 2013. Oh, as a Samsung Galaxy phoe user, I think you may ever have the trouble about Samsung Galaxy photo loss caused by deletion. Then, you should wonder how to recover deleted photos from Samsung Galaxy phone.

Yes, I ever was one of the Samsung Galaxy photo loser, and when I accidentally deleted photos from my Samsung Galaxy S4, I was so eager to find a solution for Android photos recovery. Finally I got the fastest way!! Keep reading!

How can I recover deleted photos from Samasung Galaxy before, not the best way

Before I recommend the fastest way for Samsung Galaxy Note 3/S4/S3 deleted photos recovery. I would like to tell you how can I get back deleted photos in common ways. As you know, every Android phone have Google service firmware, which can be made use of as a backup tool. Commonly, I used Google+ to sync my photos in Samsung Galaxy phone to the Cloud server. What's more, some 3rd-party apps allow us to save phone data to the cloud drive, such as Dropbox that I love.

At last but not the least, if you are familiar with Samsung Android gadgets, you must know a official backup and restore app in the phone that can help you backup phone data. This official app can backup photos as well. Another backup and restore tool is KIES which is provided by Samsung. The lovely KIES can helop you bakcup phone data to computer, I think it is safer to store data in computer.


However, I need other way to do Samsung Galaxy deleted photos recovery

Unfortunately, when I accidetanlly deleted photos from Samsung Galaxy S4, I couldn't find backup anywhere, I didn't do backup for deleted photos before. Thus, I needed another ways.

So many twists and turns in my life. When I think I had had not chance to restore Samsung Galaxy deleted photos. I found another ways that I metioned it as the fastest way above.

There is no doubt that, I got a recovery softwar for Android.

An effective Android data recovery software can help us find out the invisible deleted photos in the Android phone, and of coruse, it can recover them in a short time. If you are intereted, you can know more here: http://www.card-data-recovery.com/android-data-recovery.html
 
Finally, I used this fast ways to finish Samsung Galaxy Note 3/S4/S3 deleted photos recovery.

Baca Selengkapnya ....

[Scheduled release] Add names to Hangouts video calls in Google Calendar

Posted by Unknown Rabu, 22 Januari 2014 0 komentar
Starting January 29th, you will be able to give a name to Hangouts video calls in Google Calendar events. This name makes it easier for you and other guests to join the video call. Note that this feature is only available to domains that have enabled Google+ Premium Features.

Release track:
Scheduled release

Editions included: 
Google Apps for Business, Education, and Government

For more information:
https://support.google.com/a/answer/4362302

whatsnew.googleapps.com
Get these product update alerts by email
Subscribe to the RSS feed of these updates

Baca Selengkapnya ....

Amazon reveals GTA 5 for PC listing

Posted by Unknown 0 komentar
 

PC gamers may be denied access to Los Santos, but a mysterious listing on Amazon suggests a PC version of GTA V could be on the cards

Amazon appears to have inadvertendly confirmed the existence of GTA V for the PC with a listing appearing on its French and German sites.
Developer Rockstar has so far limited the game, which has sold by the boatload since it was released last year, to the PlayStation 3 and Xbox 360.
The online retailer has a habit of spilling details on forthcoming games has pulled the listing on its French site but - at the time of writing - the German page was still live.
The listing says that GTA V will be compatible with Windows 7 and Windows Vista, and is priced at 60 Euros.

Rumours of a PC version of the game have been around for a while and gained credence after a leaked bug log surfaced in an XML file and was shared around the internet.
The log contains notes on PC development bugs and DirectX 11 support, as well as audio issues and details about the smog weather setting in the game.
Here's everything we know so far about GTA V appearing on PC.
If Amazon's slip-up is anything to go by, we could be seeing a PC version of the game in the next couple of months. Unfortunately, no-one seems to know if a next-generation versions for the PlayStation 4 and Xbox One are in the works.

Source: http://www.t3.com/news/amazon-reveals-gta-5-for-pc-listing

Baca Selengkapnya ....

Create background of Popup Window with custom shape

Posted by Unknown 0 komentar
Last example display "PopupWindow with transparent background". I want to have transparent background with visible border. This example create background with custom shape, have rounded border, semi-transparent background.

Popup Window with background of custom shape
Popup Window with background of custom shape
Create /res/drawable/customborder.xml to define custom shape.
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<corners
android:topLeftRadius="0dp"
android:topRightRadius="30dp"
android:bottomRightRadius="30dp"
android:bottomLeftRadius="30dp" />
<stroke
android:width="3dp"
android:color="@android:color/background_dark" />
<solid
android:color="#800000c0"/>
</shape>

Modify /res/layout/popup.xml to define android:background="@drawable/customborder".
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="@drawable/customborder"
android:orientation="vertical" >

<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_margin="1dp"
android:orientation="vertical" >

<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_margin="20dp"
android:orientation="vertical" >

<TextView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="It's a PopupWindow" />

<ImageView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:src="@drawable/ic_launcher" />

<Spinner
android:id="@+id/popupspinner"
android:spinnerMode="dialog"
android:layout_width="fill_parent"
android:layout_height="wrap_content" />

<Button
android:id="@+id/dismiss"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="Dismiss" />
</LinearLayout>
</LinearLayout>

</LinearLayout>

download filesDownload the files.

Next: Implement drag-and-drop movable PopupWindow




Baca Selengkapnya ....

PopupWindow with transparent background

Posted by Unknown 0 komentar
PopupWindow with transparent background
PopupWindow with transparent background
A simple way to make background of PopupWindow transparent, you can define android:background="@android:color/transparent" in layout XML of the PopupWindow.

popup.xml
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="@android:color/transparent"
android:orientation="vertical" >

<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_margin="1dp"
android:orientation="vertical" >

<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_margin="20dp"
android:orientation="vertical" >

<TextView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="It's a PopupWindow" />

<ImageView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:src="@drawable/ic_launcher" />

<Spinner
android:id="@+id/popupspinner"
android:spinnerMode="dialog"
android:layout_width="fill_parent"
android:layout_height="wrap_content" />

<Button
android:id="@+id/dismiss"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="Dismiss" />
</LinearLayout>
</LinearLayout>

</LinearLayout>

MainActivity.java
package com.example.androidpopupwindow;

import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup.LayoutParams;
import android.widget.ArrayAdapter;
import android.widget.Button;
import android.widget.PopupWindow;
import android.widget.Spinner;
import android.app.Activity;

public class MainActivity extends Activity {

String[] DayOfWeek = {"Sunday", "Monday", "Tuesday",
"Wednesday", "Thursday", "Friday", "Saturday"};

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

final Button btnOpenPopup = (Button) findViewById(R.id.openpopup);
btnOpenPopup.setOnClickListener(new Button.OnClickListener() {

@Override
public void onClick(View arg0) {
LayoutInflater layoutInflater =
(LayoutInflater)getBaseContext()
.getSystemService(LAYOUT_INFLATER_SERVICE);
View popupView = layoutInflater.inflate(R.layout.popup, null);
final PopupWindow popupWindow = new PopupWindow(
popupView, LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT);

Button btnDismiss = (Button)popupView.findViewById(R.id.dismiss);

Spinner popupSpinner = (Spinner)popupView.findViewById(R.id.popupspinner);

ArrayAdapter<String> adapter =
new ArrayAdapter<String>(MainActivity.this,
android.R.layout.simple_spinner_item, DayOfWeek);
adapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
popupSpinner.setAdapter(adapter);

btnDismiss.setOnClickListener(new Button.OnClickListener(){

@Override
public void onClick(View v) {
popupWindow.dismiss();
}});

popupWindow.showAsDropDown(btnOpenPopup, 50, -30);
}

});
}

}

activity_main.xml
<LinearLayout 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:orientation="vertical"
android:paddingBottom="@dimen/activity_vertical_margin"
android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingTop="@dimen/activity_vertical_margin"
tools:context=".MainActivity" >

<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="http://android-er.blogspot.com/"
android:textStyle="bold"
android:layout_gravity="center_horizontal"
android:autoLink="web" />

<Button
android:id="@+id/openpopup"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="Open Popup Window" />

<ImageView
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:src="@drawable/ic_launcher" />

</LinearLayout>

download filesDownload the files.

Next: Creat background of Popup Window with custom shape




Baca Selengkapnya ....

Targeted legal holds in Google Vault

Posted by Unknown Selasa, 21 Januari 2014 0 komentar
Vault admins have had the ability to put an entire user account on hold to preserve messages in that account. Over the next few days we are releasing a feature that will give admins the ability to also have the option to target specific messages—for example, by date or with certain terms—for indefinite preservation in Vault.

Editions included: 
Google Apps for Business, Education, and Government

For more information:
https://support.google.com/vault/answer/4359587
https://support.google.com/vault/answer/2473591

whatsnew.googleapps.com
Get these product update alerts by email
Subscribe to the RSS feed of these updates

Baca Selengkapnya ....
Trik SEO Terbaru support Online Shop Baju Wanita - Original design by Bamz | Copyright of android gingerbread.