Skip to content
This repository was archived by the owner on Jul 25, 2019. It is now read-only.

Commit 53b77c7

Browse files
authored
Merge pull request #280 from uservoice/ops-2962
2 parents 10bafca + 79ccf86 commit 53b77c7

File tree

7 files changed

+32
-23
lines changed

7 files changed

+32
-23
lines changed

UVDemo/AndroidManifest.xml

-3
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,6 @@
44
android:versionCode="110"
55
android:versionName="1.1.0" >
66

7-
<uses-sdk
8-
android:minSdkVersion="14"
9-
android:targetSdkVersion="26" />
107
<uses-permission android:name="android.permission.INTERNET"/>
118

129
<application

UVDemo/build.gradle

+6-1
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,11 @@ buildscript {
66
name 'Google'
77
}
88
mavenCentral()
9+
google()
910
}
1011

1112
dependencies {
12-
classpath 'com.android.tools.build:gradle:3.2.0'
13+
classpath 'com.android.tools.build:gradle:3.3.2'
1314
}
1415
}
1516

@@ -57,6 +58,10 @@ android {
5758
debuggable true
5859
}
5960
}
61+
defaultConfig {
62+
minSdkVersion 18
63+
targetSdkVersion 26
64+
}
6065
}
6166

6267
task askForPasswords << {

UserVoiceSDK/AndroidManifest.xml

+6-10
Original file line numberDiff line numberDiff line change
@@ -5,18 +5,14 @@
55
android:versionCode="1"
66
android:versionName="0.0.1">
77

8-
<uses-sdk
9-
android:minSdkVersion="14"
10-
android:targetSdkVersion="26" />
11-
128
<uses-permission android:name="android.permission.INTERNET"/>
139
<application>
14-
<activity android:name="com.uservoice.uservoicesdk.activity.PortalActivity" android:theme="@style/UserVoiceTheme" />
15-
<activity android:name="com.uservoice.uservoicesdk.activity.ForumActivity" android:theme="@style/UserVoiceTheme" />
16-
<activity android:name="com.uservoice.uservoicesdk.activity.ArticleActivity" android:theme="@style/UserVoiceTheme" />
17-
<activity android:name="com.uservoice.uservoicesdk.activity.TopicActivity" android:theme="@style/UserVoiceTheme" />
18-
<activity android:name="com.uservoice.uservoicesdk.activity.ContactActivity" android:theme="@style/UserVoiceTheme" android:configChanges="orientation|keyboardHidden|screenSize" />
19-
<activity android:name="com.uservoice.uservoicesdk.activity.PostIdeaActivity" android:theme="@style/UserVoiceTheme" android:configChanges="orientation|keyboardHidden|screenSize" />
10+
<activity android:name="com.uservoice.uservoicesdk.activity.PortalActivity" android:theme="@style/UserVoiceTheme" android:label="@string/uv_portal_title" />
11+
<activity android:name="com.uservoice.uservoicesdk.activity.ForumActivity" android:theme="@style/UserVoiceTheme" android:label="@string/uv_feedback_forum" />
12+
<activity android:name="com.uservoice.uservoicesdk.activity.ArticleActivity" android:theme="@style/UserVoiceTheme" android:label="@string/uv_all_articles" />
13+
<activity android:name="com.uservoice.uservoicesdk.activity.TopicActivity" android:theme="@style/UserVoiceTheme" android:label="@string/uv_portal_title" />
14+
<activity android:name="com.uservoice.uservoicesdk.activity.ContactActivity" android:theme="@style/UserVoiceTheme" android:configChanges="orientation|keyboardHidden|screenSize" android:label="@string/uv_contact_us" />
15+
<activity android:name="com.uservoice.uservoicesdk.activity.PostIdeaActivity" android:theme="@style/UserVoiceTheme" android:configChanges="orientation|keyboardHidden|screenSize" android:label="@string/uv_idea_form_title" />
2016
</application>
2117

2218
</manifest>

UserVoiceSDK/build.gradle

+6-1
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,11 @@ buildscript {
66
name 'Google'
77
}
88
mavenCentral()
9+
google()
910
}
1011

1112
dependencies {
12-
classpath 'com.android.tools.build:gradle:3.2.0'
13+
classpath 'com.android.tools.build:gradle:3.3.2'
1314
}
1415
}
1516

@@ -51,6 +52,10 @@ android {
5152
res.srcDirs = ['res']
5253
}
5354
}
55+
defaultConfig {
56+
minSdkVersion 18
57+
targetSdkVersion 26
58+
}
5459
}
5560

5661
dependencies {

UserVoiceSDK/res/layout/uv_text_field_item.xml

+2-8
Original file line numberDiff line numberDiff line change
@@ -6,22 +6,16 @@
66

77
<include layout="@layout/uv_header_item" />
88

9-
<LinearLayout
10-
android:layout_width="match_parent"
11-
android:layout_height="match_parent"
12-
android:orientation="vertical"
13-
android:paddingLeft="10dp"
14-
android:paddingRight="10dp" >
15-
169
<EditText
1710
android:id="@+id/uv_text_field"
1811
android:layout_width="match_parent"
1912
android:layout_height="wrap_content"
2013
android:inputType="text"
14+
android:layout_marginLeft="10dp"
15+
android:layout_marginRight="10dp"
2116
android:ems="10" >
2217

2318
<requestFocus />
2419
</EditText>
25-
</LinearLayout>
2620

2721
</LinearLayout>

UserVoiceSDK/src/com/uservoice/uservoicesdk/ui/InstantAnswersAdapter.java

+2
Original file line numberDiff line numberDiff line change
@@ -226,12 +226,14 @@ public void afterTextChanged(Editable s) {
226226
emailField = field;
227227
field.setHint(R.string.uv_email_address_hint);
228228
field.setInputType(EditorInfo.TYPE_TEXT_VARIATION_EMAIL_ADDRESS);
229+
title.setLabelFor(emailField.getId());
229230
} else if (type == NAME_FIELD) {
230231
title.setText(R.string.uv_your_name);
231232
restoreEnteredText(nameField, field, Session.getInstance().getName(context));
232233
nameField = field;
233234
field.setHint(R.string.uv_name_hint);
234235
field.setInputType(EditorInfo.TYPE_TEXT_VARIATION_PERSON_NAME);
236+
title.setLabelFor(nameField.getId());
235237
}
236238
} else if (type == HEADING) {
237239
TextView textView = (TextView) view.findViewById(R.id.uv_header_text);

UserVoiceSDK/src/com/uservoice/uservoicesdk/ui/PostIdeaAdapter.java

+10
Original file line numberDiff line numberDiff line change
@@ -89,12 +89,14 @@ public View getView(int position, View convertView, ViewGroup parent) {
8989
descriptionField.setInputType(InputType.TYPE_CLASS_TEXT | InputType.TYPE_TEXT_FLAG_MULTI_LINE);
9090
descriptionField.setMinLines(1);
9191
descriptionField.setHint(R.string.uv_idea_description_hint);
92+
title.setLabelFor(descriptionField.getId());
9293
} else if (type == CATEGORY) {
9394
view = inflater.inflate(R.layout.uv_select_field_item, null);
9495
TextView title = (TextView) view.findViewById(R.id.uv_header_text);
9596
categorySelect = (Spinner) view.findViewById(R.id.uv_select_field);
9697
categorySelect.setAdapter(new SpinnerAdapter<Category>(context, Session.getInstance().getForum().getCategories()));
9798
title.setText(R.string.uv_category);
99+
title.setLabelFor(categorySelect.getId());
98100
} else if (type == HELP) {
99101
view = inflater.inflate(R.layout.uv_idea_help_item, null);
100102
} else if (type == TEXT_HEADING) {
@@ -153,4 +155,12 @@ protected String getSubmitString() {
153155
return context.getString(R.string.uv_submit_idea);
154156
}
155157

158+
@Override
159+
public void onChildViewAdded(View parent, View child) {
160+
if (state == State.DETAILS && descriptionField != null)
161+
descriptionField.requestFocus();
162+
else
163+
super.onChildViewAdded(parent, child);
164+
}
165+
156166
}

0 commit comments

Comments
 (0)