Back to project page videoMerge.
The source code is released under:
Apache License
If you think the Android project videoMerge listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
package com.dragonplayer.merge.fragment; /*from w w w . j ava2s. co m*/ import android.app.AlertDialog; import android.app.Dialog; import android.content.Context; import android.content.DialogInterface; import android.content.Intent; import android.content.DialogInterface.OnCancelListener; import android.content.SharedPreferences; import android.content.SharedPreferences.Editor; import android.graphics.Color; import android.graphics.drawable.ColorDrawable; import android.net.Uri; import android.os.AsyncTask; import android.os.Bundle; import android.support.v4.app.Fragment; import android.support.v4.app.FragmentActivity; import android.support.v4.view.ViewPager; import android.util.DisplayMetrics; import android.util.Log; import android.view.*; import android.view.View.OnClickListener; import android.webkit.WebView; import android.webkit.WebViewClient; import android.widget.*; import com.dragonplayer.merge.LoadingDialog; import com.dragonplayer.merge.MainActivity; import com.dragonplayer.merge.R; import com.dragonplayer.merge.adapter.ProjectListAdapter; import com.dragonplayer.merge.frames.Frames; import com.dragonplayer.merge.frames.ProjectFiles; import com.dragonplayer.merge.utils.AppConnectivity; import com.dragonplayer.merge.utils.BannerData; import com.dragonplayer.merge.utils.DlgWindow2; import com.dragonplayer.merge.utils.DlgWindow4; import com.dragonplayer.merge.utils.Utils; import com.dragonplayer.merge.utils.WebService; import java.lang.reflect.Field; import org.json.JSONArray; import org.json.JSONException; import org.json.JSONObject; /** * * @author ?????????? * */ public class UploadFragment extends BaseFragment { ImageView imgSelectMedia; TextView txtExplain; LoadingDialog mLoadingProgress; boolean bRegSuccess = false; Dialog mDialog; public UploadFragment() { } public void onActivityCreated(Bundle bundle) { super.onActivityCreated(bundle); } public void onCreate(Bundle bundle) { super.onCreate(bundle); setRetainInstance(true); } public View onCreateView(LayoutInflater layoutinflater, ViewGroup viewgroup, Bundle bundle) { View view = layoutinflater.inflate(R.layout.upload_fragment, viewgroup, false); initBottomTab(view, TABUPLOAD); txtExplain = (TextView) view.findViewById(R.id.txtexplain); WebView wv = (WebView)view.findViewById(R.id.webView1); String data= "<pre><p style=\"font-size:14px;font-family:'Apple LiGothic';color:#4F81BD;\">(????)</p>" + "<p style=\"font-size:14px;font-family:'Apple LiGothic';color:#C01900;\">???????</p>" + "<p style=\"font-size:14px;font-family:'Apple LiGothic';\">???????9/15 10/31</p><p style=\"font-size:14px;font-family:'Apple LiGothic';\">?????????????????????????????</p><ol><li style=\"font-size:14px;font-family:'Apple LiGothic';\">" + "??????????????????" + "</li><li style=\"font-size:14px;font-family:'" + "Apple LiGothic';\">??SK2U??????????????<br s" + "tyle=\"font-size:14px;font-family:'Apple LiGothi" + "c';\">???????</br></li><li style=\"font-size:14" + "px;font-family:'Apple LiGothic';\">????????????????" + "?</li><li style=\"font-size:14px;font-family:'Apple LiG" + "othic';\">?????????????????????????<br style=\"font-size:" + "14px;font-family:'Apple LiGothic';\">?????????????????" + "??????<br>?????????</br></li></ol><p style=\"font-size:14px;font-f" + "amily:'Apple LiGothic';color:#C01900;\">???????</p>????????2" + "??????????????<br/>????2??????????????????????4???<br/>??" + "TASTy?????????1???????????<br/>???" + "????????4???????????????????<br/>????1???</p>" + "<p style=\"font-size:14px;font-family:'Apple LiGothic'" + ";\"></p><p style=\"font-size:14px;font-family:" + "'Apple LiGothic';color:#C01900;\">??????</p><ol><l" + "i style=\"font-size:14px;font-family:'Apple LiGothic'" + ";\">???????????????????<br/>??????????(?????????)??????<br/>?" + "????????????????????<br/>??????????????????????<br/>????????????" + "??????????<br/>??????????????????????<br/>?????????????????" + "</li><li style=\"font-size:14px;font-fa" + "mily:'Apple LiGothic';\">???????????????" + "?????<br/>????1,000??????????<br/>????(???)20," + "000???????<br/>10%???????????????<br/>????????????" + "???????<br/>????????????????<br/>??????????????????????<br" + "/>???????????????</li><li style=\"font-size:14px;font-family:'Apple LiGothic';\">??????????????????<br/>????????????????<br/>???????????????<br/>???????????????<br/>?????????</li><li style=\"font-size:14px;font-family:'Apple LiGothic';\">??????????????????<br/>???(02)7746-4100??????<br/>???~?(9:30~18:00)?mail<br/>?<a href=\"mailto:service@skywind.com.tw\">service@skywind.com.tw</a>????</li></ol></pre>"; wv.loadDataWithBaseURL(null, data, "text/html", "utf-8", null); wv.setWebViewClient(new WebViewClient(){ @Override public boolean shouldOverrideUrlLoading(WebView view, String url) { if(url.startsWith("mailto")) { //???????? Uri uri = Uri.parse("mailto:service@skywind.com.tw"); Intent it = new Intent(Intent.ACTION_SENDTO, uri); startActivity(it); } if (url.startsWith("tel")) { //???????? Uri uri = Uri.parse("tel:0277464100"); Intent it = new Intent(Intent.ACTION_DIAL, uri); startActivity(it); } return true; } }); imgSelectMedia = (ImageButton) view.findViewById(R.id.btnselectmedia); RelativeLayout.LayoutParams params = (RelativeLayout.LayoutParams) imgSelectMedia.getLayoutParams(); DisplayMetrics displaymetrics = getActivity().getResources().getDisplayMetrics(); params.height = displaymetrics.widthPixels * 120 / 721; imgSelectMedia.setLayoutParams(params); imgSelectMedia.setOnClickListener(new OnClickListener() { @Override public void onClick(View v) { // TODO Auto-generated method stub AppConnectivity connection = new AppConnectivity(getActivity().getApplicationContext()); boolean isInternet = connection.isConnectingToInternet(); if (!isInternet) { mDialog = new DlgWindow4(getActivity(), R.style.CustomDialog, "?????", "??", new OnClickListener() { @Override public void onClick(View v) { // TODO Auto-generated method stub mDialog.dismiss(); } }); mDialog.show(); return; } SharedPreferences sp = getActivity().getSharedPreferences("iDragon", Context.MODE_PRIVATE); String actId = sp.getString("actId", ""); String tel = sp.getString("tel", ""); mLoadingProgress = new LoadingDialog(getActivity()); mLoadingProgress.getWindow().setBackgroundDrawable(new ColorDrawable(Color.TRANSPARENT)); mLoadingProgress.show(); AsyncCallWS task = new AsyncCallWS(); task.execute(actId, tel); } }); return view; } public void onDetach() { try { Field field = Fragment.class.getDeclaredField("mChildFragmentManager"); field.setAccessible(true); field.set(this, null); } catch(NoSuchFieldException nosuchfieldexception) { throw new RuntimeException(nosuchfieldexception); } catch(IllegalAccessException illegalaccessexception) { throw new RuntimeException(illegalaccessexception); } super.onDetach(); } private class AsyncCallWS extends AsyncTask<String, Void, Void> { private String mResult = ""; @Override protected Void doInBackground(String... params) { String actId = params[0]; String tel = params[1]; mResult = WebService.ChkAct(actId, tel, "ChkAct"); return null; } @Override protected void onPostExecute(Void result) { if (mLoadingProgress != null) { mLoadingProgress.dismiss(); mLoadingProgress = null; } if (mResult.toUpperCase().equals("YES")) { mDialog = new DlgWindow2(getActivity(), R.style.CustomDialog, "????????????", "?????????", "??", new OnClickListener() { @Override public void onClick(View v) { // TODO Auto-generated method stub mDialog.dismiss(); SharedPreferences sp = getActivity().getSharedPreferences("iDragon", Context.MODE_PRIVATE); String actId = sp.getString("actId", ""); String tel = sp.getString("tel", ""); String username = sp.getString("username", ""); String email = sp.getString("email", ""); String filepath = sp.getString("filepath", ""); ((MainActivity)getActivity()).onClickUploadConfirm(actId, username, email, tel, filepath); } }, new OnClickListener() { @Override public void onClick(View v) { // TODO Auto-generated method stub mDialog.dismiss(); } }); mDialog.show(); } else { //????????????SHOW????? String data = getString(R.string.uploadmessage); AlertDialog.Builder builder = new AlertDialog.Builder(((MainActivity ) getActivity())); builder.setMessage(data); builder.setPositiveButton(getString(R.string.upload_alertdialog_yes), new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialog, int which) { // TODO Auto-generated method stub ((MainActivity)getActivity()).onClickUploadInfo(); }}); builder.setNegativeButton(getString(R.string.upload_alertdialog_no), new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialog, int which) { // TODO Auto-generated method stub //??AlertDialog?? dialog.cancel(); } }); builder.create(); builder.show(); } } @Override protected void onPreExecute() { } @Override protected void onProgressUpdate(Void... values) { } } }