All possible last minute changes and cleanup before release

This commit is contained in:
TwistedUmbrella 2014-02-26 22:24:34 -05:00
parent bac4ee15ec
commit f670a39787
8 changed files with 47 additions and 30 deletions

View File

@ -77,6 +77,7 @@
<string name="beta_site">Betas: http://reicast.loungekatt.com</string>
<string name="git_api">https://api.github.com/repos/reicast/reicast-emulator/commits</string>
<string name="git_issues">https://github.com/reicast/reicast-emulator/issues/</string>
<string name="log_url">http://twisted.dyndns.tv:3194/ReicastBot/report/submit.php</string>
<string-array name="controllers">
<item>Controller A</item>

View File

@ -73,6 +73,7 @@ import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;
import android.annotation.TargetApi;
import android.app.Activity;
import android.content.pm.PackageManager.NameNotFoundException;
import android.os.AsyncTask;
@ -94,6 +95,7 @@ import android.widget.Toast;
import com.reicast.emulator.debug.GitAdapter;
@SuppressWarnings("deprecation")
public class AboutFragment extends Fragment {
SlidingDrawer slidingGithub;
@ -153,6 +155,7 @@ public class AboutFragment extends Fragment {
slidingGithub = (SlidingDrawer) getView().findViewById(
R.id.slidingGithub);
slidingGithub.setOnDrawerOpenListener(new OnDrawerOpenListener() {
@TargetApi(Build.VERSION_CODES.HONEYCOMB)
public void onDrawerOpened() {
String git = parentActivity.getString(R.string.git_api);
retrieveGitTask queryGithub = new retrieveGitTask();
@ -278,6 +281,7 @@ public class AboutFragment extends Fragment {
ArrayList<HashMap<String, String>> commitList) {
if (commitList != null && commitList.size() > 0) {
list = (ListView) getView().findViewById(R.id.list);
list.setSelector(R.drawable.list_selector);
list.setChoiceMode(ListView.CHOICE_MODE_SINGLE);
adapter = new GitAdapter(parentActivity, commitList);
// Set adapter as specified collection

View File

@ -18,6 +18,7 @@ import android.app.Activity;
import android.content.Context;
import android.content.SharedPreferences;
import android.content.res.Resources;
import android.graphics.Typeface;
import android.graphics.drawable.Drawable;
import android.net.Uri;
import android.os.AsyncTask;
@ -283,6 +284,8 @@ public class FileBrowser extends Fragment {
.setImageResource(R.drawable.open_folder);
((TextView) headerView.findViewById(R.id.item_name))
.setText(header_text);
((TextView) headerView.findViewById(R.id.item_name))
.setTypeface(Typeface.DEFAULT_BOLD);
((ViewGroup) view).addView(headerView);
}

View File

@ -12,7 +12,6 @@ import java.io.InputStreamReader;
import android.content.Context;
import android.os.AsyncTask;
import android.os.Build;
import android.os.Handler;
import android.widget.Toast;
import com.reicast.emulator.R;
@ -90,7 +89,7 @@ public class GenerateLogs extends AsyncTask<String, Integer, String> {
/**
* Read the output of a shell command
*
* @param string
* @param command
* The shell command being issued to the terminal
*/
public static String readOutput(String command) {
@ -184,7 +183,7 @@ public class GenerateLogs extends AsyncTask<String, Integer, String> {
mLogcatProc = null;
reader = null;
mLogcatProc = Runtime.getRuntime().exec(
new String[] { "logcat", "-d", "GL3JNIView:E *:S" });
new String[] { "logcat", "-d", "GL2JNIView:E *:S" });
reader = new BufferedReader(new InputStreamReader(
mLogcatProc.getInputStream()));
log.append(separator);

View File

@ -58,6 +58,8 @@ package com.reicast.emulator.debug;
import java.util.ArrayList;
import java.util.HashMap;
import android.annotation.SuppressLint;
import android.annotation.TargetApi;
import android.app.Activity;
import android.app.AlertDialog;
import android.content.Context;
@ -74,7 +76,6 @@ import android.webkit.WebSettings;
import android.webkit.WebSettings.PluginState;
import android.webkit.WebView;
import android.webkit.WebViewClient;
import android.webkit.WebViewDatabase;
import android.widget.BaseAdapter;
import android.widget.ImageView;
import android.widget.RelativeLayout;
@ -98,16 +99,14 @@ public class GitAdapter extends BaseAdapter {
this.data = d;
this.inflater = (LayoutInflater) activity
.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
ImageLoaderConfiguration configicon = new ImageLoaderConfiguration.Builder(activity)
.memoryCacheExtraOptions(96, 96)
.build();
this.options = new DisplayImageOptions.Builder()
.showStubImage(R.drawable.ic_github)
.showImageForEmptyUri(R.drawable.ic_github)
.imageScaleType(ImageScaleType.EXACTLY_STRETCHED)
.build();
ImageLoaderConfiguration configicon = new ImageLoaderConfiguration.Builder(
activity).memoryCacheExtraOptions(96, 96).build();
this.options = new DisplayImageOptions.Builder()
.showStubImage(R.drawable.ic_github)
.showImageForEmptyUri(R.drawable.ic_github)
.imageScaleType(ImageScaleType.EXACTLY_STRETCHED).build();
ImageLoader.getInstance().init(configicon);
ImageLoader.getInstance().init(configicon);
}
@ -154,7 +153,8 @@ public class GitAdapter extends BaseAdapter {
dateText.setText(date);
committerText.setText(committer);
titleText.setText(title);
ImageLoader.getInstance().displayImage(avatar, avatarIcon, this.options);
ImageLoader.getInstance()
.displayImage(avatar, avatarIcon, this.options);
vi.setOnClickListener(new OnClickListener() {
public void onClick(View v) {
@ -167,6 +167,7 @@ public class GitAdapter extends BaseAdapter {
return vi;
}
public static void displayCommit(String title, String message, String url,
Context context) {
final AlertDialog.Builder builder = new AlertDialog.Builder(context);
@ -187,19 +188,22 @@ public class GitAdapter extends BaseAdapter {
});
builder.create().show();
}
@TargetApi(Build.VERSION_CODES.HONEYCOMB)
@SuppressLint("SetJavaScriptEnabled")
@SuppressWarnings("deprecation")
public static WebView configureWebview(String url, Context context,
WebView mWebView) {
mWebView.getSettings().setSupportZoom(true);
mWebView.getSettings().setBuiltInZoomControls(true);
if (Integer.parseInt(Build.VERSION.SDK) >= Build.VERSION_CODES.HONEYCOMB) {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB) {
mWebView.getSettings().setDisplayZoomControls(false);
}
mWebView.setInitialScale(1);
if (Integer.parseInt(Build.VERSION.SDK) >= Build.VERSION_CODES.ECLAIR) {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.ECLAIR) {
mWebView.getSettings().setUseWideViewPort(true);
}
if (Integer.parseInt(Build.VERSION.SDK) >= Build.VERSION_CODES.ECLAIR_MR1) {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.ECLAIR_MR1) {
mWebView.getSettings().setLoadWithOverviewMode(true);
}
mWebView.getSettings().setJavaScriptEnabled(true);
@ -208,13 +212,10 @@ public class GitAdapter extends BaseAdapter {
mWebView.clearHistory();
mWebView.clearFormData();
mWebView.clearCache(true);
WebViewDatabase mDatabase = WebViewDatabase.getInstance(context);
mDatabase.clearUsernamePassword();
CookieSyncManager.createInstance(context);
CookieManager cookieManager = CookieManager.getInstance();
cookieManager.removeAllCookie();
CookieSyncManager.getInstance().stopSync();
mWebView.getSettings().setSavePassword(false);
mWebView.setWebViewClient(new WebViewClient() {
@Override
public boolean shouldOverrideUrlLoading(WebView view, String url) {

View File

@ -16,6 +16,7 @@ import org.apache.http.message.BasicNameValuePair;
import org.apache.http.util.EntityUtils;
import android.annotation.SuppressLint;
import android.annotation.TargetApi;
import android.content.Context;
import android.content.Intent;
import android.net.Uri;
@ -28,9 +29,9 @@ import com.reicast.emulator.R;
/**
* Upload the specialized logcat to reicast issues
*
* @param context
* @param mContext
* The context this method will be executed from
* @param string
* @param currentTime
* The system time at which the log was made
*/
public class UploadLogs extends AsyncTask<String, Integer, Object> {
@ -60,7 +61,7 @@ public class UploadLogs extends AsyncTask<String, Integer, Object> {
/**
* Set the URL for where the log will be uploaded
*
* @param string
* @param logUrl
* The URL of the log upload server
*/
public void setPostUrl(String logUrl) {
@ -70,7 +71,7 @@ public class UploadLogs extends AsyncTask<String, Integer, Object> {
@SuppressLint("NewApi")
protected void onPreExecute() {
if (logUrl == null || logUrl.equals(null)) {
logUrl = "http://twisted.dyndns.tv:3194/ReicastBot/report/submit.php";
logUrl = mContext.getString(R.string.log_url);
}
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.GINGERBREAD) {
StrictMode.ThreadPolicy policy = new StrictMode.ThreadPolicy.Builder()
@ -79,6 +80,7 @@ public class UploadLogs extends AsyncTask<String, Integer, Object> {
}
}
@TargetApi(Build.VERSION_CODES.HONEYCOMB)
@Override
protected Object doInBackground(String... params) {
HttpClient client = new DefaultHttpClient();
@ -113,6 +115,8 @@ public class UploadLogs extends AsyncTask<String, Integer, Object> {
return null;
}
@TargetApi(Build.VERSION_CODES.HONEYCOMB)
@SuppressWarnings("deprecation")
@Override
protected void onPostExecute(Object response) {
if (response != null && !response.equals(null)) {

View File

@ -1,15 +1,20 @@
package com.reicast.emulator.emu;
import java.util.Locale;
import javax.microedition.khronos.egl.EGL10;
import javax.microedition.khronos.egl.EGLConfig;
import javax.microedition.khronos.egl.EGLContext;
import javax.microedition.khronos.egl.EGLDisplay;
import android.annotation.TargetApi;
import android.opengl.EGL14;
import android.opengl.EGLExt;
import android.opengl.GLSurfaceView;
import android.os.Build;
import android.util.Log;
@TargetApi(Build.VERSION_CODES.JELLY_BEAN_MR2)
public class GLCFactory6 {
private static void LOGI(String S) { Log.i("GL2JNIView-v6",S); }
@ -44,7 +49,7 @@ public class GLCFactory6 {
int error;
while((error=egl.eglGetError()) != EGL14.EGL_SUCCESS)
LOGE(String.format("%s: EGL error: 0x%x",prompt,error));
LOGE(String.format(Locale.getDefault(), "%s: EGL error: 0x%x",prompt,error));
}
public static class ConfigChooser implements GLSurfaceView.EGLConfigChooser
@ -93,7 +98,7 @@ public class GLCFactory6 {
EGL14.EGL_GREEN_SIZE, 4,
EGL14.EGL_BLUE_SIZE, 4,
EGL14.EGL_RENDERABLE_TYPE, renderableType,
EGL14.EGL_DEPTH_SIZE, 16,
EGL14.EGL_DEPTH_SIZE, 24,
EGL14.EGL_NONE
};
@ -113,7 +118,7 @@ public class GLCFactory6 {
// Get all matching configurations.
EGLConfig[] configs = new EGLConfig[mValue[0]];
if (GL2JNIView.DEBUG)
LOGW(String.format("%d configurations", configs.length));
LOGW(String.format(Locale.getDefault(), "%d configurations", configs.length));
if (!egl.eglChooseConfig(display, configSpec, configs, mValue[0], mValue)) {
throw new IllegalArgumentException("Could not get config data");
}
@ -235,7 +240,7 @@ public class GLCFactory6 {
for(int i=0 ; i<attributes.length ; i++)
if(egl.eglGetConfigAttrib(display,config,attributes[i],value))
LOGI(String.format(" %s: %d\n",names[i],value[0]));
LOGI(String.format(Locale.getDefault(), " %s: %d\n",names[i],value[0]));
else
while(egl.eglGetError()!=EGL14.EGL_SUCCESS);
}

View File

@ -13,7 +13,7 @@ public class JNIdc
public static native int send(int cmd, int opt);
public static native int data(int cmd, byte[] data);
public static native void rendinit(int w,int y);
public static native void rendinit(int w, int y);
public static native void rendframe();
public static native void kcode(int[] kcode, int[] lt, int[] rt, int[] jx, int[] jy);