Workaround for 4.0.3. xxxhdpi image for subtitles. Some other small changes.

This commit is contained in:
RIP95 2017-03-07 18:40:29 +03:00
parent e0677090f7
commit a806c0a768
5 changed files with 35 additions and 5 deletions

View File

@ -23,4 +23,5 @@ android {
dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
compile 'com.android.support:appcompat-v7:25.2.0'
compile 'org.apache.directory.studio:org.apache.commons.io:2.4'
}

View File

@ -147,4 +147,4 @@ public class LaunchActivity extends AppCompatActivity {
}
}
}
}

View File

@ -5,6 +5,7 @@ package com.example.yink.amadeus;
*/
import android.Manifest;
import android.content.ActivityNotFoundException;
import android.content.Context;
import android.content.Intent;
import android.content.SharedPreferences;
@ -152,7 +153,34 @@ public class MainActivity extends AppCompatActivity {
intent.putExtra(RecognizerIntent.EXTRA_LANGUAGE, "en-US");
}
sr.startListening(intent);
/* Temporary workaround for strange bug on 4.0.3-4.0.4 */
if (Build.VERSION.SDK_INT == Build.VERSION_CODES.ICE_CREAM_SANDWICH_MR1) {
try {
startActivityForResult(intent, 1);
} catch (ActivityNotFoundException a) {
a.printStackTrace();
}
} else {
sr.startListening(intent);
}
}
@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
super.onActivityResult(requestCode, resultCode, data);
switch (requestCode) {
case 1: {
if (resultCode == RESULT_OK && null != data) {
ArrayList<String> input = data
.getStringArrayListExtra(RecognizerIntent.EXTRA_RESULTS);
answerSpeech(input.get(0));
}
break;
}
}
}
public void speak(VoiceLine line) {

Binary file not shown.

After

Width:  |  Height:  |  Size: 527 KiB

View File

@ -47,11 +47,12 @@
<ImageView
android:id="@+id/imageView_logo"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_alignParentTop="true"
android:layout_centerHorizontal="true"
android:adjustViewBounds="true"
android:src="@drawable/logo_animation" />
android:src="@drawable/logo_animation"
android:layout_above="@+id/textView_call" />
</RelativeLayout>