Scrollview autoscroll with enter key in editext android - android-edittext

I have a layout in which I have 4 edittext in nestedscrollview
<?xml version="1.0" encoding="utf-8"?>
<android.support.design.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fitsSystemWindows="true">
<android.support.design.widget.AppBarLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
>
<android.support.v7.widget.Toolbar
android:id="#+id/toolbar"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:background="#android:color/white"
>
<TextView
android:id="#+id/back"
android:layout_width="50dp"
android:layout_height="50dp"
android:textColor="#android:color/black"
android:textSize="17sp"
android:background="#drawable/logo" />
<TextView
android:id="#+id/toolbar_title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:textColor="#android:color/black"
android:textSize="17sp" />
</android.support.v7.widget.Toolbar>
</android.support.design.widget.AppBarLayout>
<android.support.v4.widget.NestedScrollView xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:id="#+id/container"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:scrollbars="vertical"
android:focusable="true"
android:focusableInTouchMode="true"
app:layout_behavior="#string/appbar_scrolling_view_behavior"
tools:context="labs108.com.dentalstudent.activity.MainActivity">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="30dp"
android:layout_marginBottom="30dp"
android:orientation="vertical">
<TextView
android:id="#id/name"
android:layout_marginTop="5dp"
android:text="#string/mayank_agrawal"
android:textSize="17sp"
android:textStyle="bold"
android:textDirection="ltr"
android:gravity="center_horizontal"
android:textColor="#android:color/black"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
<TextView
android:id="#+id/mobile"
android:layout_marginTop="5dp"
android:text="#string/mobile_no"
android:textSize="14sp"
android:textDirection="ltr"
android:gravity="center_horizontal"
android:textColor="#android:color/holo_green_light"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
<TextView
android:id="#+id/gender"
android:layout_marginTop="5dp"
android:text="#string/gender_text"
android:textSize="14sp"
android:textStyle="bold"
android:textDirection="ltr"
android:gravity="center_horizontal"
android:textColor="#android:color/holo_green_light"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
<TextView
android:id="#+id/age"
android:layout_marginTop="5dp"
android:text="#string/age_text"
android:textSize="14sp"
android:textDirection="ltr"
android:textStyle="bold"
android:gravity="center_horizontal"
android:textColor="#android:color/holo_green_light"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
<TextView
android:id="#+id/date"
android:layout_marginTop="5dp"
android:text="#string/date"
android:textSize="14sp"
android:textDirection="ltr"
android:textStyle="bold"
android:gravity="center_horizontal"
android:textColor="#android:color/holo_green_light"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
<TextView
android:id="#+id/explain"
android:layout_marginTop="5dp"
android:text="#string/explain"
android:textSize="14sp"
android:textDirection="ltr"
android:textStyle="bold"
android:gravity="center_horizontal"
android:textColor="#android:color/holo_green_light"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
<TextView
android:id="#+id/complain"
android:layout_marginTop="5dp"
android:text="#string/complain_text"
android:textSize="14sp"
android:textDirection="ltr"
android:textStyle="bold"
android:gravity="center_horizontal"
android:textColor="#android:color/holo_green_light"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
<TextView
android:layout_marginTop="10dp"
android:text="#string/upload_pic"
android:textSize="14sp"
android:gravity="center_horizontal"
android:textDirection="ltr"
android:textColor="#android:color/black"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
<ProgressBar
android:id="#+id/progressbar1"
android:layout_centerInParent="true"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
style="?android:attr/progressBarStyleLarge" />
<ImageView
android:layout_marginTop="20dp"
android:layout_marginLeft="20dp"
android:layout_marginRight="20dp"
android:id="#+id/pic1"
android:adjustViewBounds="true"
android:scaleType="centerCrop"
android:layout_gravity="center_horizontal"
android:layout_width="350dp"
android:layout_height="200dp" />
</RelativeLayout>
<TextView
android:gravity="center_horizontal"
android:id="#+id/show1"
android:text="Show Pic"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
<EditText
android:id="#+id/edit1"
android:layout_marginTop="30dp"
android:layout_marginRight="10dp"
android:layout_marginLeft="10dp"
android:gravity="start"
android:textDirection="anyRtl"
android:scrollbars="vertical"
android:textAlignment="viewStart"
android:background="#android:drawable/editbox_background_normal"
android:layout_width="match_parent"
android:layout_height="150dp" />
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
<ProgressBar
android:id="#+id/progressbar2"
android:layout_centerInParent="true"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
style="?android:attr/progressBarStyleLarge" />
<ImageView
android:layout_marginTop="20dp"
android:layout_marginLeft="20dp"
android:layout_marginRight="20dp"
android:id="#+id/pic2"
android:adjustViewBounds="true"
android:scaleType="centerCrop"
android:layout_gravity="center_horizontal"
android:layout_width="350dp"
android:layout_height="200dp" />
</RelativeLayout>
<TextView
android:gravity="center_horizontal"
android:id="#+id/show2"
android:text="Show Pic"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
<EditText
android:id="#+id/edit2"
android:layout_marginTop="30dp"
android:layout_marginRight="10dp"
android:layout_marginLeft="10dp"
android:gravity="start"
android:textDirection="anyRtl"
android:scrollbars="vertical"
android:textAlignment="viewStart"
android:background="#android:drawable/editbox_background_normal"
android:layout_width="match_parent"
android:layout_height="150dp" />
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
<ProgressBar
android:id="#+id/progressbar3"
android:layout_centerInParent="true"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
style="?android:attr/progressBarStyleLarge" />
<ImageView
android:layout_marginTop="20dp"
android:layout_marginLeft="20dp"
android:layout_marginRight="20dp"
android:id="#+id/pic3"
android:adjustViewBounds="true"
android:scaleType="centerCrop"
android:layout_gravity="center_horizontal"
android:layout_width="350dp"
android:layout_height="200dp" />
</RelativeLayout>
<TextView
android:gravity="center_horizontal"
android:id="#+id/show3"
android:text="Show Pic"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
<EditText
android:id="#+id/edit3"
android:layout_marginTop="30dp"
android:layout_marginRight="10dp"
android:layout_marginLeft="10dp"
android:gravity="start"
android:textDirection="anyRtl"
android:scrollbars="vertical"
android:textAlignment="viewStart"
android:background="#android:drawable/editbox_background_normal"
android:layout_width="match_parent"
android:layout_height="150dp" />
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
<ProgressBar
android:id="#+id/progressbar4"
android:layout_centerInParent="true"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
style="?android:attr/progressBarStyleLarge" />
<ImageView
android:layout_marginTop="20dp"
android:layout_marginLeft="20dp"
android:layout_marginRight="20dp"
android:id="#+id/pic4"
android:adjustViewBounds="true"
android:scaleType="centerCrop"
android:layout_gravity="center_horizontal"
android:layout_width="350dp"
android:layout_height="200dp" />
</RelativeLayout>
<TextView
android:gravity="center_horizontal"
android:id="#+id/show4"
android:text="Show Pic"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
<EditText
android:id="#+id/edit4"
android:layout_marginTop="20dp"
android:layout_marginRight="10dp"
android:layout_marginLeft="10dp"
android:gravity="start"
android:textDirection="anyRtl"
android:scrollbars="vertical"
android:textAlignment="viewStart"
android:background="#android:drawable/editbox_background_normal"
android:layout_width="match_parent"
android:layout_height="150dp" />
<TextView
android:id="#id/save"
android:layout_marginTop="10dp"
android:text="#string/save"
android:textDirection="ltr"
android:layout_marginBottom="60dp"
android:textSize="15sp"
android:background="#android:drawable/editbox_background_normal"
android:layout_gravity="center_horizontal"
android:gravity="center"
android:textColor="#android:color/holo_green_light"
android:layout_width="200dp"
android:layout_height="40dp" />
</LinearLayout>
</android.support.v4.widget.NestedScrollView>
</android.support.design.widget.CoordinatorLayout>
WHen I enter text in edittext and press enter from keyboard, scrollview also scroll and with multiple enter, edittext is completely invisible because of scrolling of scrollview.
is there any thing wrong in layout?

Related

Cytoskape xgmml edge.color and edge weight is not getting applied, how should I change this?

I made an .xgmml file to load into cytoscape. In the .xgmml I have different weights and colours for the edges (See bottom for the .xgmml file). However, when I load the .xgmml file into cytoscape and apply layout, the edges have the same weights and colour.
How can I apply the .xgmml edge weights and colours to the network?
<?xml version="1.0" encoding="UTF-8" ?>
<graph label="Depression" directed="0" xmlns="http://www.cs.rpi.edu/XGMML" schemaLocation="http://www.cs.rpi.edu/~puninj/XGMML/xgmml.xsd">
<node id="A" label="A">
<graphics type="rectangle" fill="#F8FF00"/>
<att name="description" value="A"/>
</node>
<node id="B" label="B">
<graphics type="triangle" fill="#CC51FF"/>
<att name="description" value="B"/>
</node>
<node id="C" label="C">
<graphics type="triangle" fill="#CC51FF"/>
<att name="description" value="C"/>
</node>
<edge id="rs2" label="TRANS" source="A" target="B" weight="10">
<att name="edge.shape" value="circle"/>
<att name="edge.color" value="51,153,25"/>
</edge>
<edge id="rs1" label="CIS" source="A" target="C" weight="1">
<att name="edge.shape" value="circle"/>
<att name="edge.color" value="0,153,0"/>
</edge>
</graph>
We don't use those properties. For color and width, we encode them as attributes in the graphic line:
<edge id="732" label="YDR412W (pp) YPR119W" source="386" target="382" cy:directed="1">
<att name="shared name" value="YDR412W (pp) YPR119W" type="string" cy:type="String"/>
<att name="shared interaction" value="pp" type="string" cy:type="String"/>
<att name="name" value="YDR412W (pp) YPR119W" type="string" cy:type="String"/>
<att name="selected" value="1" type="boolean" cy:type="Boolean"/>
<att name="interaction" value="pp" type="string" cy:type="String"/>
<att name="EdgeBetweenness" value="18040.0" type="real" cy:type="Double"/>
<att name="isInPath" value="0" type="boolean" cy:type="Boolean" cy:hidden="1"/>
<graphics width="5.0" fill="#FF00FF">
<att name="EDGE_STROKE_SELECTED_PAINT" value="#FF0000" type="string" cy:type="String"/>
<att name="EDGE_SELECTED" value="true" type="string" cy:type="String"/>
<att name="EDGE_TOOLTIP" value="" type="string" cy:type="String"/>
<att name="EDGE_LABEL_COLOR" value="#000000" type="string" cy:type="String"/>
<att name="EDGE_BEND" value="" type="string" cy:type="String"/>
<att name="EDGE_TARGET_ARROW_UNSELECTED_PAINT" value="#000000" type="string" cy:type="String"/>
<att name="EDGE_TARGET_ARROW_SELECTED_PAINT" value="#FFFF00" type="string" cy:type="String"/>
<att name="EDGE_LABEL" value="" type="string" cy:type="String"/>
<att name="EDGE_TARGET_ARROW_SIZE" value="6.0" type="string" cy:type="String"/>
<att name="EDGE_SOURCE_ARROW_SIZE" value="6.0" type="string" cy:type="String"/>
<att name="EDGE_CURVED" value="true" type="string" cy:type="String"/>
<att name="EDGE_VISIBLE" value="true" type="string" cy:type="String"/>
<att name="EDGE_SOURCE_ARROW_SELECTED_PAINT" value="#FFFF00" type="string" cy:type="String"/>
<att name="EDGE_SOURCE_ARROW_SHAPE" value="NONE" type="string" cy:type="String"/>
<att name="EDGE_LABEL_TRANSPARENCY" value="255" type="string" cy:type="String"/>
<att name="EDGE_TRANSPARENCY" value="170" type="string" cy:type="String"/>
<att name="EDGE_LINE_TYPE" value="SOLID" type="string" cy:type="String"/>
<att name="EDGE_SOURCE_ARROW_UNSELECTED_PAINT" value="#000000" type="string" cy:type="String"/>
<att name="EDGE_LABEL_FONT_FACE" value="Dialog.plain,plain,10" type="string" cy:type="String"/>
<att name="EDGE_LABEL_FONT_SIZE" value="10" type="string" cy:type="String"/>
<att name="EDGE_TARGET_ARROW_SHAPE" value="NONE" type="string" cy:type="String"/>
<att name="EDGE_LABEL_WIDTH" value="200.0" type="string" cy:type="String"/>
</graphics>
</edge>
This results in a magenta edge of width 5.
-- scooter

How to configure the layout so that the output will be output on the listview below the input search

I have created a design with the following source axml:
when the listview output is shown getting data from the sqllite database the listview will overlap the test textview,edittext as below:
Required Output Result Listview should be below as shown below:
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:background="#ffffff"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<TextView
android:text="#string/test"
android:textAppearance="?android:attr/textAppearanceLarge"
android:layout_width="87.5dp"
android:layout_height="wrap_content"
android:id="#+id/test"
android:textColor="#android:color/black" />
<EditText
android:id="#+id/test_input"
android:layout_height="wrap_content"
android:layout_width="152.0dp"
android:inputType="text"
android:layout_toRightOf="#+id/test" />
<Button
android:id="#+id/MyButton"
android:layout_width="128.5dp"
android:layout_height="wrap_content"
android:text="#string/ButtonClick"
android:layout_toRightOf="#+id/test_input" />
<ListView
android:minWidth="25px"
android:minHeight="25px"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="#+id/listtable"
android:layout_alignBottom="#+id/MyButton" />
</RelativeLayout>
Assuming you are using the Appcompat Library i would do the following changes to your layout :
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:background="#ffffff"
android:layout_width="match_parent"
android:layout_height="match_parent">
<android.support.v7.widget.LinearLayoutCompat
android:layout_width="match_parent"
android:orientation="horizontal"
android:id="#+id/LinearContent"
android:layout_alignParentTop="true"
android:layout_height="wrap_content">
<TextView
android:text="Test"
android:textAppearance="?android:attr/textAppearanceLarge"
android:layout_width="87.5dp"
android:layout_height="wrap_content"
android:id="#+id/test"
android:textColor="#android:color/black" />
<EditText
android:id="#+id/test_input"
android:layout_height="wrap_content"
android:layout_width="152.0dp"
android:inputType="text"
android:layout_toRightOf="#+id/test" />
<Button
android:id="#+id/MyButton"
android:layout_width="128.5dp"
android:layout_height="wrap_content"
android:text="Search"
android:layout_toRightOf="#+id/test_input" />
</android.support.v7.widget.LinearLayoutCompat>
<android.support.v7.widget.LinearLayoutCompat
android:layout_width="match_parent"
android:orientation="vertical"
android:layout_below="#id/LinearContent"
android:layout_height="wrap_content">
<ListView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="#+id/listtable"
/>
</android.support.v7.widget.LinearLayoutCompat>
Revert in case it doesn't work
Solved.
Change the properties of list view with the following:
android:layout_alignBottom to
android:layout_below

Android UI cordinator layout or nested scroll view issue

I am using a nested scrollview in CoordinatorLayout I have different horizontal cords which are stacked in nested scrollview . I am unable to fix the space which is not required (I have added blue color to the space).
Anybody any fix or what am I doing wrong?
<android.support.design.widget.CoordinatorLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:fresco="http://schemas.android.com/tools"
android:id="#+id/cordinator_layout"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#00f"
app:layout_scrollFlags="scroll|enterAlways">
<android.support.design.widget.AppBarLayout
android:id="#+id/appBar"
android:layout_width="match_parent"
android:layout_height="300dp"
android:fitsSystemWindows="true"
android:theme="#style/ThemeOverlay.AppCompat.Dark.ActionBar">
<android.support.design.widget.CollapsingToolbarLayout
android:id="#+id/collapsingToolbar"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fitsSystemWindows="true"
app:contentScrim="?attr/colorPrimary"
app:expandedTitleMarginEnd="64dp"
app:expandedTitleMarginStart="48dp"
app:layout_scrollFlags="scroll|exitUntilCollapsed">
<com.facebook.drawee.view.SimpleDraweeView
android:id="#+id/movie_poster"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_alignParentTop="true"
android:fitsSystemWindows="true"
android:scaleType="centerCrop"
app:layout_collapseMode="pin"
fresco:placeholderImage="#drawable/placeholder" />
<android.support.design.widget.TabLayout
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:layout_gravity="bottom"
app:tabContentStart="72dp"
app:tabMode="scrollable" />
<android.support.v7.widget.Toolbar
android:id="#+id/toolbar"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
app:layout_collapseMode="pin"
app:popupTheme="#style/ThemeOverlay.AppCompat.Light" />
</android.support.design.widget.CollapsingToolbarLayout>
</android.support.design.widget.AppBarLayout>
<android.support.v4.widget.NestedScrollView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_below="#id/appBar"
android:fitsSystemWindows="true"
app:layout_behavior="#string/appbar_scrolling_view_behavior">
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="#0f0"
android:orientation="vertical">
<android.support.v7.widget.CardView
android:id="#+id/info_card_view"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<TextView
android:id="#+id/plot_synopsis"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="#color/cardview_dark_background"
android:maxLines="4"
android:paddingLeft="10dp"
android:paddingRight="10dp"
android:textColor="#fff"
android:textSize="21sp" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#color/cardview_dark_background"
android:orientation="horizontal">
<LinearLayout
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="3"
android:baselineAligned="false"
android:orientation="vertical"
android:padding="10dp"
android:weightSum="4">
<TextView
android:id="#+id/release_date"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="#fff"
android:textSize="20sp" />
<TextView
android:id="#+id/vote"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="#fff"
android:textSize="20sp" />
</LinearLayout>
<Button
android:id="#+id/b11"
style="?android:attr/buttonStyleSmall"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="#drawable/fav" />
</LinearLayout>
</LinearLayout>
</android.support.v7.widget.CardView>
<LinearLayout
android:id="#+id/nextAirLayout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="10dp"
android:layout_marginTop="10dp"
android:background="#color/cardview_dark_background"
android:orientation="vertical">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_margin="10dp"
android:text="#string/next_episode"
android:textColor="#fff"
android:textStyle="bold" />
<include
layout="#layout/episode_layout"
android:layout_width="match_parent"
android:layout_height="match_parent" />
</LinearLayout>
<include
android:id="#+id/tvSeasonsCard"
layout="#layout/image_card"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="10dp"
android:layout_marginTop="10dp" />
<include
android:id="#+id/tvCastCard"
layout="#layout/image_card"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="10dp"
android:layout_marginTop="10dp" />
<include
android:id="#+id/videosCard"
layout="#layout/image_card"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="10dp"
android:layout_marginTop="10dp" />
<include
android:id="#+id/similarTvShowsCard"
layout="#layout/image_card"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="10dp"
android:layout_marginTop="10dp" />
<include
android:id="#+id/recommendedTvShowsCard"
layout="#layout/image_card"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="10dp"
android:layout_marginTop="10dp" />
</LinearLayout>
</android.support.v4.widget.NestedScrollView>
</android.support.design.widget.CoordinatorLayout>

PhoneGap Cordova YoutubeVideoPlayer Plugin An error this could be due to network issue of YouTube protocols

I create a "Play Youtube" App with PhoneGap(version 6.3.0) , Cordova (version 6.3.1) , simple load a youtube video by ID.
use Cordova YoutubeVideoPlayer plugin, using build.phonegap.com to build project, but not working with error:
An error occurred during the retrieval of the video. This could be due to network issue of YouTube protocols. Please try again later.
I test on android OS version 6.0.
Thanks in advance.
add to config.xml:
<plugin name="com.bunkerpalace.cordova.youtubevideoplayer" spec="1.0.1" source="pgb" />
Load youtube video when device ready in index.js
YoutubeVideoPlayer.openVideo('1s96mq8kfzY');
index.js
var app = {
initialize: function() {
this.bindEvents();
}, bindEvents: function() {
document.addEventListener('deviceready', this.onDeviceReady, false);
}, onDeviceReady: function() {
app.receivedEvent('deviceready');
},
receivedEvent: function(id) {
var parentElement = document.getElementById(id);
var listeningElement = parentElement.querySelector('.listening');
var receivedElement = parentElement.querySelector('.received');
listeningElement.setAttribute('style', 'display:none;');
receivedElement.setAttribute('style', 'display:block;');
console.log('Received Event: ' + id);
YoutubeVideoPlayer.openVideo('1s96mq8kfzY');
}
};
index.html
<html>
<head>
<meta charset="utf-8" />
<meta name="format-detection" content="telephone=no" />
<meta name="msapplication-tap-highlight" content="no" />
<meta name="viewport" content="user-scalable=no, initial-scale=1, maximum-scale=1, minimum-scale=1, width=device-width" />
<link rel="stylesheet" type="text/css" href="css/index.css" />
<title>Hello World</title>
</head>
<body>
<div class="app">
<h1>PhoneGap</h1>
<div id="deviceready" class="blink">
<p class="event listening">Connecting to Device</p>
<p class="event received">Device is Ready</p>
</div>
</div>
<script type="text/javascript" src="cordova.js"></script>
<script type="text/javascript" src="js/index.js"></script>
<script type="text/javascript">
app.initialize();
</script>
</body>
</html>
config.xml
<?xml version='1.0' encoding='utf-8'?>
<widget id="com.hd.yu" version="1.0.0" xmlns="http://www.w3.org/ns/widgets" xmlns:gap="http://phonegap.com/ns/1.0">
<name>YTube2</name>
<description>
Hello World sample application that responds to the deviceready event.
</description>
<author email="support#phonegap.com" href="http://phonegap.com">
PhoneGap Team
</author>
<content src="index.html" />
<preference name="DisallowOverscroll" value="true" />
<preference name="android-minSdkVersion" value="14" />
<plugin name="cordova-plugin-battery-status" source="npm" spec="~1.1.1" />
<plugin name="cordova-plugin-camera" source="npm" spec="~2.1.1" />
<plugin name="cordova-plugin-media-capture" source="npm" spec="~1.2.0" />
<plugin name="cordova-plugin-console" source="npm" spec="~1.0.2" />
<plugin name="cordova-plugin-contacts" source="npm" spec="~2.0.1" />
<plugin name="cordova-plugin-device" source="npm" spec="~1.1.1" />
<plugin name="cordova-plugin-device-motion" source="npm" spec="~1.2.0" />
<plugin name="cordova-plugin-device-orientation" source="npm" spec="~1.0.2" />
<plugin name="cordova-plugin-dialogs" source="npm" spec="~1.2.0" />
<plugin name="cordova-plugin-file" source="npm" spec="~4.1.1" />
<plugin name="cordova-plugin-file-transfer" source="npm" spec="~1.5.0" />
<plugin name="cordova-plugin-geolocation" source="npm" spec="~2.1.0" />
<plugin name="cordova-plugin-globalization" source="npm" spec="~1.0.3" />
<plugin name="cordova-plugin-inappbrowser" source="npm" spec="~1.3.0" />
<plugin name="cordova-plugin-media" source="npm" spec="~2.2.0" />
<plugin name="cordova-plugin-network-information" source="npm" spec="~1.2.0" />
<plugin name="cordova-plugin-splashscreen" source="npm" spec="~3.2.1" />
<plugin name="cordova-plugin-statusbar" source="npm" spec="~2.1.2" />
<plugin name="cordova-plugin-vibration" source="npm" spec="~2.1.0" />
<plugin name="cordova-plugin-whitelist" source="npm" spec="~1.2.1" />
<plugin name="com.bunkerpalace.cordova.youtubevideoplayer" spec="1.0.1" source="pgb" />
<icon src="icon.png" />
<platform name="android">
<icon density="ldpi" src="www/res/icon/android/drawable-ldpi-icon.png" />
<icon density="mdpi" src="www/res/icon/android/drawable-mdpi-icon.png" />
<icon density="hdpi" src="www/res/icon/android/drawable-hdpi-icon.png" />
<icon density="xhdpi" src="www/res/icon/android/drawable-xhdpi-icon.png" />
<icon density="xxhdpi" src="www/res/icon/android/drawable-xxhdpi-icon.png" />
<icon density="xxxhdpi" src="www/res/icon/android/drawable-xxxhdpi-icon.png" />
<splash density="land-ldpi" src="www/res/screen/android/drawable-land-ldpi-screen.png" />
<splash density="land-mdpi" src="www/res/screen/android/drawable-land-mdpi-screen.png" />
<splash density="land-hdpi" src="www/res/screen/android/drawable-land-hdpi-screen.png" />
<splash density="land-xhdpi" src="www/res/screen/android/drawable-land-xhdpi-screen.png" />
<splash density="land-xxhdpi" src="www/res/screen/android/drawable-land-xxhdpi-screen.png" />
<splash density="land-xxxhdpi" src="www/res/screen/android/drawable-land-xxxhdpi-screen.png" />
<splash density="port-ldpi" src="www/res/screen/android/drawable-port-ldpi-screen.png" />
<splash density="port-mdpi" src="www/res/screen/android/drawable-port-mdpi-screen.png" />
<splash density="port-hdpi" src="www/res/screen/android/drawable-port-hdpi-screen.png" />
<splash density="port-xhdpi" src="www/res/screen/android/drawable-port-xhdpi-screen.png" />
<splash density="port-xxhdpi" src="www/res/screen/android/drawable-port-xxhdpi-screen.png" />
<splash density="port-xxxhdpi" src="www/res/screen/android/drawable-port-xxxhdpi-screen.png" />
</platform>
<platform name="ios">
<icon height="57" platform="ios" src="www/res/icon/ios/icon.png" width="57" />
<icon height="114" platform="ios" src="www/res/icon/ios/icon#2x.png" width="114" />
<icon height="40" platform="ios" src="www/res/icon/ios/icon-40.png" width="40" />
<icon height="80" platform="ios" src="www/res/icon/ios/icon-40#2x.png" width="80" />
<icon height="50" platform="ios" src="www/res/icon/ios/icon-50.png" width="50" />
<icon height="100" platform="ios" src="www/res/icon/ios/icon-50#2x.png" width="100" />
<icon height="60" platform="ios" src="www/res/icon/ios/icon-60.png" width="60" />
<icon height="120" platform="ios" src="www/res/icon/ios/icon-60#2x.png" width="120" />
<icon height="180" platform="ios" src="www/res/icon/ios/icon-60#3x.png" width="180" />
<icon height="72" platform="ios" src="www/res/icon/ios/icon-72.png" width="72" />
<icon height="144" platform="ios" src="www/res/icon/ios/icon-72#2x.png" width="144" />
<icon height="76" platform="ios" src="www/res/icon/ios/icon-76.png" width="76" />
<icon height="152" platform="ios" src="www/res/icon/ios/icon-76#2x.png" width="152" />
<icon height="29" platform="ios" src="www/res/icon/ios/icon-small.png" width="29" />
<icon height="58" platform="ios" src="www/res/icon/ios/icon-small#2x.png" width="58" />
<icon height="87" platform="ios" src="www/res/icon/ios/icon-small#3x.png" width="87" />
<splash height="1136" platform="ios" src="www/res/screen/ios/Default-568h#2x~iphone.png" width="640" />
<splash height="1334" platform="ios" src="www/res/screen/ios/Default-667h.png" width="750" />
<splash height="2208" platform="ios" src="www/res/screen/ios/Default-736h.png" width="1242" />
<splash height="1242" platform="ios" src="www/res/screen/ios/Default-Landscape-736h.png" width="2208" />
<splash height="1536" platform="ios" src="www/res/screen/ios/Default-Landscape#2x~ipad.png" width="2048" />
<splash height="768" platform="ios" src="www/res/screen/ios/Default-Landscape~ipad.png" width="1024" />
<splash height="2048" platform="ios" src="www/res/screen/ios/Default-Portrait#2x~ipad.png" width="1536" />
<splash height="1024" platform="ios" src="www/res/screen/ios/Default-Portrait~ipad.png" width="768" />
<splash height="960" platform="ios" src="www/res/screen/ios/Default#2x~iphone.png" width="640" />
<splash height="480" platform="ios" src="www/res/screen/ios/Default~iphone.png" width="320" />
</platform>
<platform name="wp8">
<icon height="99" platform="wp8" src="www/res/icon/wp8/ApplicationIcon.png" width="99" />
<icon height="159" platform="wp8" src="www/res/icon/wp8/Background.png" width="159" />
<splash height="1280" platform="wp8" src="www/res/screen/wp8/screen-portrait.jpg" width="768" />
</platform>
<platform name="windows">
<icon height="150" platform="windows" src="www/res/icon/windows/Square150x150Logo.scale-100.png" width="150" />
<icon height="30" platform="windows" src="www/res/icon/windows/Square30x30Logo.scale-100.png" width="30" />
<icon height="50" platform="windows" src="www/res/icon/windows/StoreLogo.scale-100.png" width="50" />
<splash height="300" platform="windows" src="www/res/screen/windows/SplashScreen.scale-100.png" width="620" />
<icon height="120" platform="windows" src="www/res/icon/windows/StoreLogo.scale-240.png" width="120" />
<icon height="44" platform="windows" src="www/res/icon/windows/Square44x44Logo.scale-100.png" width="44" />
<icon height="106" platform="windows" src="www/res/icon/windows/Square44x44Logo.scale-240.png" width="106" />
<icon height="70" platform="windows" src="www/res/icon/windows/Square70x70Logo.scale-100.png" width="70" />
<icon height="71" platform="windows" src="www/res/icon/windows/Square71x71Logo.scale-100.png" width="71" />
<icon height="170" platform="windows" src="www/res/icon/windows/Square71x71Logo.scale-240.png" width="170" />
<icon height="360" platform="windows" src="www/res/icon/windows/Square150x150Logo.scale-240.png" width="360" />
<icon height="310" platform="windows" src="www/res/icon/windows/Square310x310Logo.scale-100.png" width="310" />
<icon height="150" platform="windows" src="www/res/icon/windows/Wide310x150Logo.scale-100.png" width="310" />
<icon height="360" platform="windows" src="www/res/icon/windows/Wide310x150Logo.scale-240.png" width="744" />
<splash height="1920" platform="windows" src="www/res/screen/windows/SplashScreenPhone.scale-240.png" width="1152" />
</platform>
<access origin="*" />
<allow-intent href="http://*/*" />
<allow-intent href="https://*/*" />
<allow-intent href="tel:*" />
<allow-intent href="sms:*" />
<allow-intent href="mailto:*" />
<allow-intent href="geo:*" />
<platform name="android">
<allow-intent href="market:*" />
</platform>
<platform name="ios">
<allow-intent href="itms:*" />
<allow-intent href="itms-apps:*" />
</platform>
<engine name="android" spec="~5.2.2" />
</widget>

How to set editView minimum Width? (Android 2.2)

I have a table containing two tableRows each holding four Views: texView, Spinner, editView and texView.
When the content of one of the spinner's childs doesn't fit, it is automatically cut of, which is fine. However I want the editView next to it keep a minimum width of 40dp. Now the width of the textViews are preserved but the editView width is not. How can I achieve that (if not by setting width and/or minwidth as I tried now, see xml file)?
Up until this child's length its fine:
Now its not so fine:
Here's the layout file:
<?xml version="1.0" encoding="utf-8"?>
<ScrollView 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"
tools:ignore="InefficientWeight" >
<TableLayout
android:layout_width="match_parent"
android:layout_height="wrap_content" >
<TextView
android:id="#+id/textView3"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingLeft="10dp"
android:text="Worp "
android:textAppearance="?android:attr/textAppearanceLarge" />
<TableRow
android:id="#+id/tableRow1"
android:layout_width="wrap_content"
android:layout_height="wrap_content" >
<TextView
android:id="#+id/textView1"
android:layout_width="40dp"
android:layout_height="wrap_content"
android:paddingLeft="10dp"
android:textAppearance="?android:attr/textAppearanceLarge" />
<Spinner
android:id="#+id/spinner1"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:drawSelectorOnTop="true"
android:tag="SP1" />
<EditText
android:id="#+id/editText1"
android:layout_width="40dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:ems="10"
android:inputType="phone"
android:minWidth="40dp" />
<TextView
android:id="#+id/textView4"
android:layout_width="40dp"
android:layout_height="wrap_content"
android:gravity="center_horizontal"
android:textAppearance="?android:attr/textAppearanceLarge" />
</TableRow>
<TableRow
android:id="#+id/tableRow2"
android:layout_width="wrap_content"
android:layout_height="wrap_content" >
<TextView
android:id="#+id/textView2"
android:layout_width="40dp"
android:layout_height="wrap_content"
android:paddingLeft="10dp"
android:textAppearance="?android:attr/textAppearanceLarge" />
<Spinner
android:id="#+id/spinner2"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:drawSelectorOnTop="true"
android:tag="SP2" />
<EditText
android:id="#+id/editText2"
android:layout_width="40dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:ems="10"
android:inputType="phone"
android:minWidth="40dp" >
<requestFocus />
</EditText>
<TextView
android:id="#+id/textView5"
android:layout_width="40dp"
android:layout_height="wrap_content"
android:gravity="center_horizontal"
android:textAppearance="?android:attr/textAppearanceLarge" />
</TableRow>
<TableRow
android:id="#+id/tableRow3"
android:layout_width="wrap_content"
android:layout_height="wrap_content" >
</TableRow>
<TableRow
android:id="#+id/tableRow4"
android:layout_width="wrap_content"
android:layout_height="wrap_content" >
</TableRow>
</TableLayout>
</ScrollView>
It seems that because of the wrap_content attribute the width of your table column is changing. Try to change the attributes of table row from wrap_content to match_parent or try using weightSum.

Resources