fixing ci errors

This commit is contained in:
Mariotaku Lee 2015-11-26 10:37:07 +08:00
parent 01ef660720
commit 34f3758158
4 changed files with 31 additions and 10 deletions

View File

@ -21,11 +21,11 @@ android:
# if you need to run emulator(s) during your tests
# - sys-img-armeabi-v7a-android-19
# - sys-img-x86-android-17
jdk:
- oraclejdk7
sudo: false
jdk:
- oraclejdk8
env:
global:
MALLOC_ARENA_MAX=2
@ -37,6 +37,10 @@ addons:
- libmagic1
- p7zip-full
cache:
directories:
- $HOME/.local/opt
before_install:
- ./scripts/install_android_ndk.sh
- export PATH=$HOME/.local/bin:$PATH

View File

@ -1,12 +1,30 @@
#!/bin/bash
local_opt_dir="${HOME}/.local/opt"
ndk_name="android-ndk-r10e"
ndk_install_dest="${local_opt_dir}/${ndk_name}"
if [ -d ${ndk_install_dest} ];
then exit
fi
cd ${local_opt_dir}
if [ `uname -m` = x86_64 ];
then
ndk_installer_name="${ndk_name}-linux-x86_64.bin"
wget http://dl.google.com/android/ndk/android-ndk-r10e-linux-x86_64.bin -O ndk.bin
else
wget http://dl.google.com/android/ndk/android-ndk-r10e-linux-x86.bin -O ndk.bin
ndk_installer_name="${ndk_name}-linux-x86.bin"
fi
7z x ndk.bin android-ndk-r10e/build/ android-ndk-r10e/ndk-build android-ndk-r10e/platforms/android-21 > /dev/null
export ANDROID_NDK_HOME=`pwd`/android-ndk-r10e
echo "ndk.dir=$ANDROID_NDK_HOME" >> local.properties
wget "http://dl.google.com/android/ndk/${ndk_installer_name}"
chmod +x ${ndk_installer_name}
./${ndk_installer_name} -y
rm ${ndk_installer_name}
echo "ndk.dir=${ndk_install_dest}" >> ./local.properties

View File

@ -116,7 +116,6 @@ import static org.mariotaku.twidere.util.Utils.getTabDisplayOptionInt;
import static org.mariotaku.twidere.util.Utils.isDatabaseReady;
import static org.mariotaku.twidere.util.Utils.openMessageConversation;
import static org.mariotaku.twidere.util.Utils.openSearch;
import static org.mariotaku.twidere.util.Utils.showMenuItemToast;
public class HomeActivity extends BaseAppCompatActivity implements OnClickListener, OnPageChangeListener,
SupportFragmentCallback, OnLongClickListener {
@ -502,7 +501,7 @@ public class HomeActivity extends BaseAppCompatActivity implements OnClickListen
public boolean onLongClick(final View v) {
switch (v.getId()) {
case R.id.actions_button: {
showMenuItemToast(v, v.getContentDescription(), true);
Utils.showMenuItemToast(v, v.getContentDescription(), true);
return true;
}
}

View File

@ -3503,7 +3503,7 @@ public final class Utils implements Constants {
final int width = v.getWidth();
final int height = v.getHeight();
final int screenWidth = v.getResources().getDisplayMetrics().widthPixels;
final Toast cheatSheet = Toast.makeText(v.getContext(), text, Toast.LENGTH_SHORT);
final Toast cheatSheet = Toast.makeText(v.getContext().getApplicationContext(), text, Toast.LENGTH_SHORT);
if (isBottomBar) {
// Show along the bottom center
cheatSheet.setGravity(Gravity.BOTTOM | Gravity.CENTER_HORIZONTAL, 0, height);