Showing posts with label select. Show all posts
Showing posts with label select. Show all posts

Make TextView selectable select and copy

| 0 comments |

Example to make TextView selectable, you can select and copy text from TextView and paste to other field, such as EditText.


Add android_textIsSelectable="true" in layout XML:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout

android_layout_width="match_parent"
android_layout_height="match_parent"
android_padding="16dp"
android_orientation="vertical"
tools_context="com.blogspot.android_er.androidselectabletext.MainActivity">

<TextView
android_layout_width="wrap_content"
android_layout_height="wrap_content"
android_layout_gravity="center_horizontal"
android_autoLink="web"
android_text="http://android-er.blogspot.com/"
android_textStyle="bold" />

<TextView
android_id="@+id/textview1"
android_layout_width="match_parent"
android_layout_height="wrap_content"
android_textSize="28sp"
android_text="Default TextView, un-selectable"/>

<TextView
android_id="@+id/textview2"
android_layout_width="match_parent"
android_layout_height="wrap_content"
android:textIsSelectable="true"
android_textSize="28sp"
android_text="Selectable TextView, by XML"/>

<TextView
android_id="@+id/textview3"
android_layout_width="match_parent"
android_layout_height="wrap_content"
android_textSize="28sp"
android_text="Selectable TextView, by Java code"/>

<EditText
android_id="@+id/edittext"
android_layout_width="match_parent"
android_layout_height="wrap_content"
android_textSize="28sp"/>
</LinearLayout>


or call setTextIsSelectable(true) method of the TextView object in Java code:
package com.blogspot.android_er.androidselectabletext;

import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.widget.EditText;
import android.widget.TextView;

public class MainActivity extends AppCompatActivity {

TextView textView1, textView2, textView3;
EditText editText;

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

textView1 = (TextView)findViewById(R.id.textview1);
textView2 = (TextView)findViewById(R.id.textview2);
textView3 = (TextView)findViewById(R.id.textview3);
textView3.setTextIsSelectable(true);
editText = (EditText)findViewById(R.id.edittext);
}
}



Read More..

Project Tango Tablet Development Kits coming to select countries

| 0 comments |

Posted by Larry Yang, Product Manager, Project Tango

Project Tango Tablet Development Kits are available in South Korea and Canada starting today, and on August 26, will be available in Denmark, Finland, France, Germany, Ireland, Italy, Norway, Sweden, Switzerland, and the United Kingdom. The dev kit is intended for software developers only. To order a device, visit the Google Store.

Project Tango is a mobile platform that uses computer vision to give devices the ability to sense the world around them. The Project Tango Tablet Development Kit is a standard Android device plus a wide-angle camera, a depth sensing camera, accurate sensor timestamping, and a software stack that exposes this new computer vision technology to application developers. Learn more on our website.

The Project Tango community is growing. We’ve shipped more than 3,000 developer devices so far. Developers have already created hundreds of applications that enable users to explore the physical space around them, including precise navigation without GPS, windows into virtual 3D worlds, measurement of physical spaces, and games that know where they are in the room and what’s around them. And we have an app development contest in progress right now.

We’ve released 13 software updates that make it easier to create Area Learning experiences with new capabilities such as high-accuracy and building-scale ADFs, more accurate re-localization, indoor navigation, and GPS/maps alignment. Depth Perception improvements include the addition of real-time textured and Unity meshing. Unity developers can take advantage of an improved Unity lifecycle. The updates have also included improvements in IMU characterization, performance, thermal management and drift-reduction. Visit our developer site for details.

We have a lot more to share over the coming months. Sign-up for our monthly newsletter to keep up with the latest news. Join the conversation in our Google+ community. Get help from other developers by using the Project Tango tag in Stack Overflow. See what other’s are saying on our YouTube channel. And share your story on Twitter with #ProjectTango.

Join us on our journey.

Read More..