| | |
| | | android:orientation="horizontal"> |
| | | |
| | | <CheckBox |
| | | android:visibility="gone" |
| | | android:id="@+id/cb_user_agreement" |
| | | android:layout_width="15dp" |
| | | android:layout_height="15dp" |
| | | android:layout_gravity="center_vertical" |
| | | android:background="@drawable/selector_user_agreement_checkbox" |
| | | android:button="@null" |
| | | android:checked="false" |
| | | android:checked="true" |
| | | android:gravity="center" /> |
| | | |
| | | <TextView |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="wrap_content" |
| | | android:layout_marginLeft="6.5dp" |
| | | android:text="勾选表示同意" |
| | | android:text="登录即表示同意" |
| | | android:textColor="#B3B8D3" |
| | | android:textSize="11sp" /> |
| | | |
| | |
| | | android:orientation="horizontal"> |
| | | |
| | | <CheckBox |
| | | android:visibility="gone" |
| | | android:id="@+id/cb_user_agreement" |
| | | android:layout_width="15dp" |
| | | android:layout_height="15dp" |
| | | android:layout_gravity="center_vertical" |
| | | android:background="@drawable/selector_user_agreement_checkbox" |
| | | android:button="@null" |
| | | android:checked="false" |
| | | android:checked="true" |
| | | android:gravity="center" /> |
| | | |
| | | |
| | | |
| | | <TextView |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="wrap_content" |
| | | android:layout_marginLeft="6.5dp" |
| | | android:text="注册即表示同意" |
| | | android:textColor="#B3B8D3" |
| | | android:textSize="11sp" /> |
| | | |
| | | <TextView |
| | | android:id="@+id/tv_user_agreement" |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="wrap_content" |
| | | android:layout_marginLeft="5dp" |
| | | android:text="@string/user_agreement" |
| | | android:textColor="@color/blue1" /> |
| | | android:textColor="#51B3FF" |
| | | android:textSize="11sp" /> |
| | | |
| | | <TextView |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="wrap_content" |
| | | android:text="、" |
| | | android:textColor="#B3B8D3" |
| | | android:textSize="11sp" /> |
| | | |
| | | <TextView |
| | | android:id="@+id/tv_privacy_policy" |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="wrap_content" |
| | | android:text="@string/privacy_policy" |
| | | android:textColor="#51B3FF" |
| | | android:textSize="11sp" /> |
| | | |
| | | </LinearLayout> |
| | | |
| | |
| | | import java.io.File; |
| | | import java.io.FileNotFoundException; |
| | | import java.io.IOException; |
| | | import java.util.ArrayList; |
| | | import java.util.Collections; |
| | | import java.util.HashMap; |
| | | import java.util.Iterator; |
| | | import java.util.LinkedHashMap; |
| | | import java.util.List; |
| | | import java.util.Map.Entry; |
| | | import java.util.Set; |
| | | import java.util.concurrent.TimeUnit; |
| | |
| | | LinkedHashMap<String, String> params = new LinkedHashMap<>(); |
| | | if (loginUid != null) |
| | | |
| | | if (type != null) |
| | | params.put("type", type); |
| | | if (type != null) |
| | | params.put("type", type); |
| | | |
| | | if (token != null) |
| | | params.put("regId", token); |
| | |
| | | public static LinkedHashMap<String, String> validateParams( |
| | | LinkedHashMap<String, String> params, Context context) { |
| | | params.put("System", "1"); |
| | | StringBuilder sign = new StringBuilder(); |
| | | // for (Entry<String, String> entry : params.entrySet()) { |
| | | // sign.append(entry.getValue()); |
| | | // } |
| | | sign.append(params.get("Method")) |
| | | .append(StringUtils.isEmpty(params.get("Uid")) ? params.get("Device") |
| | | : params.get("Uid")).append(params.get("System")); |
| | | if (BuildConfig.DEBUG) { |
| | | Log.i(TAG, "sign: " + sign); |
| | | } |
| | | params.put("Sign", MD5Utils.getMD532(sign.toString())); |
| | | params.put("Platform", "Android"); |
| | | params.put("Channel", ManifestDataUtil.getAppMetaData(context, "UMENG_CHANNEL")); |
| | | |
| | | //签名 |
| | | List<String> list = new ArrayList<>(); |
| | | for (Iterator<String> its = params.keySet().iterator(); its.hasNext(); ) { |
| | | String key = its.next(); |
| | | list.add(key + "=" + params.get(key)); |
| | | } |
| | | Collections.sort(list); |
| | | String str = StringUtils.toString(list, "&"); |
| | | String sign = MD5Utils.getMD532(str + "8888B&*@-uWan88/',@@^"); |
| | | params.put("Sign", sign); |
| | | return params; |
| | | } |
| | | |
| | |
| | | private static void commonPost(Context context, String url, |
| | | LinkedHashMap<String, String> params, |
| | | ResponseHandlerInterface handler) { |
| | | |
| | | LinkedHashMap<String, String> newParams = new LinkedHashMap<String, String>(); |
| | | //移除为null的值 |
| | | for (Iterator<String> its = params.keySet().iterator(); its.hasNext(); ) { |
| | | String key = its.next(); |
| | | if (params.get(key) != null) { |
| | | newParams.put(key,params.get(key)); |
| | | } |
| | | } |
| | | |
| | | |
| | | if (BeibeiConstant.isDisableProxy()) { |
| | | commonPost(context, url, params, null, handler); |
| | | commonPost(context, url, newParams, null, handler); |
| | | } else { |
| | | Toast.makeText(context, "服务器拒绝访问,请查看是否禁用了代理服务器!", |
| | | Toast.LENGTH_SHORT).show(); |
| | |
| | | package com.weikou.beibeivideo.ui.baidu; |
| | | |
| | | import android.os.Bundle; |
| | | import android.support.annotation.NonNull; |
| | | import android.support.annotation.Nullable; |
| | | import android.support.v4.app.Fragment; |
| | | import android.support.v4.app.FragmentManager; |
| | | import android.support.v4.app.FragmentStatePagerAdapter; |
| | | import android.support.v4.view.ViewPager; |
| | | import android.util.Log; |
| | | import android.view.View; |
| | | import android.widget.Toast; |
| | | |
| | |
| | | import com.weikou.beibeivideo.BeibeiVideoAPI; |
| | | import com.weikou.beibeivideo.BeibeiVideoApplication; |
| | | import com.weikou.beibeivideo.ui.MyRetainViewFragment; |
| | | import com.weikou.beibeivideo.util.ad.AdUtil; |
| | | import com.weikou.beibeivideo.util.cache.DiskLruCacheManager; |
| | | import com.weikou.beibeivideo.util.downutil.StringUtils; |
| | | import com.yeshi.ec.library_baiducpu.R; |
| | |
| | | */ |
| | | public class BaiDuNewsFragment extends MyRetainViewFragment { |
| | | |
| | | private static final String TAG = BaiDuNewsFragment.class.getSimpleName(); |
| | | private ViewPager viewPager; |
| | | private ContentAdapter contentAdapter; |
| | | private List<BaiDuCPUType> itemList = new ArrayList<>(); |
| | |
| | | |
| | | private void initData(View contentView) { |
| | | mAQuery = new AQuery(contentView); |
| | | |
| | | } |
| | | |
| | | private void initCacheData() { |
| | | //获取缓存 |
| | | String value = DiskLruCacheManager.getInstance(BeibeiVideoApplication.application).getCache(getCacheKey()); |
| | | if (!StringUtils.isNullOrEmpty(value)) { |
| | |
| | | private synchronized void setData(String json) { |
| | | List<BaiDuCPUType> list = new Gson().fromJson(json, new TypeToken<List<BaiDuCPUType>>() { |
| | | }.getType()); |
| | | |
| | | |
| | | //数据一致就不必更新 |
| | | if (itemList != null) { |
| | | String data1 = new Gson().toJson(itemList); |
| | |
| | | |
| | | @Override |
| | | public void onCreateView(View contentView, Bundle savedInstanceState) { |
| | | Log.i(TAG, "onCreateView"); |
| | | initView(contentView); |
| | | initData(contentView); |
| | | initCacheData(); |
| | | getTypeList(); |
| | | } |
| | | |
| | | @Override |
| | | public void onResume() { |
| | | super.onResume(); |
| | | if (itemList == null || itemList.size() == 0) |
| | | initCacheData(); |
| | | } |
| | | |
| | | class ContentAdapter extends FragmentStatePagerAdapter { |
| | |
| | | |
| | | @Override |
| | | public Fragment getItem(int position) { |
| | | Fragment fragment = BaiDuCPUContentFragment.newInstance(mlist.get(position), BaiDuCPUContentFragment.VIEW_TYPE_NEWS); |
| | | Fragment fragment = BaiDuCPUContentFragment.newInstance(mlist.get(position), BaiDuCPUContentFragment.VIEW_TYPE_NEWS, AdUtil.getAdPid(getContext(), AdUtil.POSITION_SPLASH) != null); |
| | | return fragment; |
| | | } |
| | | |
| | |
| | | public CharSequence getPageTitle(int position) { |
| | | return mlist.get(position).getName(); |
| | | } |
| | | |
| | | } |
| | | |
| | | @Override |
| | | public void onSaveInstanceState(@NonNull Bundle outState) { |
| | | Log.i(TAG, "onSaveInstanceState"); |
| | | super.onSaveInstanceState(outState); |
| | | } |
| | | } |
| | |
| | | import com.weikou.beibeivideo.BeibeiVideoAPI; |
| | | import com.weikou.beibeivideo.BeibeiVideoApplication; |
| | | import com.weikou.beibeivideo.ui.MyRetainViewFragment; |
| | | import com.weikou.beibeivideo.util.ad.AdUtil; |
| | | import com.weikou.beibeivideo.util.cache.DiskLruCacheManager; |
| | | import com.weikou.beibeivideo.util.downutil.StringUtils; |
| | | import com.yeshi.ec.library_baiducpu.R; |
| | |
| | | private synchronized void setData(String data) { |
| | | List<BaiDuCPUType> list = new Gson().fromJson(data, new TypeToken<List<BaiDuCPUType>>() { |
| | | }.getType()); |
| | | //删除萌萌哒 |
| | | if (list != null) |
| | | for (int i = 0; i < list.size(); i++) { |
| | | if (list.get(i).getName().contains("萌萌")) { |
| | | list.remove(i); |
| | | break; |
| | | } |
| | | } |
| | | //数据一致就不必更新 |
| | | if (itemList != null) { |
| | | String data1 = new Gson().toJson(itemList); |
| | |
| | | if (mlist.get(position).getId() == 1085) |
| | | return BaiDuShortVideosFragment.newInstance(mlist.get(position)); |
| | | else |
| | | return BaiDuCPUContentFragment.newInstance(mlist.get(position), mlist.get(position).getId() == 1085 ? BaiDuCPUContentFragment.VIEW_TYPE_SMALLVIDEO : BaiDuCPUContentFragment.VIEW_TYPE_VIDEO); |
| | | return BaiDuCPUContentFragment.newInstance(mlist.get(position), mlist.get(position).getId() == 1085 ? BaiDuCPUContentFragment.VIEW_TYPE_SMALLVIDEO : BaiDuCPUContentFragment.VIEW_TYPE_VIDEO, AdUtil.getAdPid(getContext(), AdUtil.POSITION_SPLASH) != null); |
| | | } |
| | | |
| | | @Override |
| | |
| | | import android.widget.TextView; |
| | | import android.widget.Toast; |
| | | |
| | | import com.lcjian.library.dialog.DialogUtil; |
| | | import com.lcjian.library.util.SingleToast; |
| | | import com.lcjian.library.util.common.StringUtils; |
| | | import com.tencent.mm.opensdk.modelmsg.SendAuth; |
| | |
| | | import com.weikou.beibeivideo.BeibeiVideoApplication; |
| | | import com.weikou.beibeivideo.R; |
| | | import com.weikou.beibeivideo.ui.BaseActivity; |
| | | import com.weikou.beibeivideo.ui.dialog.LoadingDialogUtil; |
| | | import com.weikou.beibeivideo.ui.mine.BrowserActivity; |
| | | import com.weikou.beibeivideo.util.BeibeiConstant; |
| | | import com.weikou.beibeivideo.util.XGPush; |
| | |
| | | |
| | | public class LoginActivity extends BaseActivity implements OnClickListener { |
| | | public static final int RESULT_LOGIN = 10; |
| | | private ProgressDialog dialog; |
| | | private LinearLayout ll_login_qq, ll_login_wx; |
| | | private boolean isTouchLogin;// 用户是否点击登录 |
| | | private String uid; |
| | |
| | | } |
| | | }); |
| | | |
| | | dialog = new ProgressDialog(this); |
| | | ll_login_content = (LinearLayout) findViewById(R.id.ll_login_content); |
| | | |
| | | int w = View.MeasureSpec.makeMeasureSpec(0, View.MeasureSpec.UNSPECIFIED); |
| | |
| | | UMAuthListener authListener = new UMAuthListener() { |
| | | @Override |
| | | public void onStart(SHARE_MEDIA platform) { |
| | | dialog.show(); |
| | | DialogUtil.show(loadingDialog); |
| | | } |
| | | |
| | | |
| | | |
| | | @Override |
| | | public void onComplete(SHARE_MEDIA platform, int action, final Map<String, String> data) { |
| | | dialog.dismiss(); |
| | | DialogUtil.dismiss(loadingDialog); |
| | | Log.i("mResult", "返回的数据为----" + data); |
| | | BeibeiVideoAPI.userLogin(LoginActivity.this, uid, |
| | | data.get("name"), data.get("openid"), |
| | |
| | | @Override |
| | | public void onFinish() { |
| | | super.onFinish(); |
| | | dialog.dismiss(); |
| | | DialogUtil.dismiss(loadingDialog); |
| | | } |
| | | }); |
| | | } |
| | |
| | | @Override |
| | | public void onError(SHARE_MEDIA platform, int action, Throwable t) { |
| | | lockBack(false); |
| | | dialog.dismiss(); |
| | | DialogUtil.dismiss(loadingDialog); |
| | | Toast.makeText(LoginActivity.this, "失败:" + t.getMessage(), Toast.LENGTH_LONG).show(); |
| | | } |
| | | |
| | | @Override |
| | | public void onCancel(SHARE_MEDIA platform, int action) { |
| | | lockBack(false); |
| | | dialog.dismiss(); |
| | | DialogUtil.dismiss(loadingDialog); |
| | | Toast.makeText(LoginActivity.this, "取消了", Toast.LENGTH_LONG).show(); |
| | | } |
| | | }; |
| | |
| | | } else { |
| | | SingleToast.showToast(LoginActivity.this, "登录失败"); |
| | | } |
| | | } |
| | | |
| | | @Override |
| | | public void onStart() { |
| | | super.onStart(); |
| | | DialogUtil.show(loadingDialog); |
| | | } |
| | | |
| | | @Override |
| | | public void onFinish() { |
| | | super.onFinish(); |
| | | DialogUtil.dismiss(loadingDialog); |
| | | } |
| | | |
| | | @Override |
| | |
| | | @Override |
| | | public void onFinish() { |
| | | super.onFinish(); |
| | | dialog.dismiss(); |
| | | DialogUtil.dismiss(loadingDialog); |
| | | } |
| | | }); |
| | | } catch (JSONException e) { |
| | |
| | | tv_confirm.setOnClickListener(this); |
| | | findViewById(R.id.tv_back).setOnClickListener(this); |
| | | findViewById(R.id.tv_user_agreement).setOnClickListener(this); |
| | | findViewById(R.id.tv_privacy_policy).setOnClickListener(this); |
| | | } |
| | | |
| | | @Override |
| | |
| | | finish(); |
| | | break; |
| | | case R.id.tv_user_agreement: |
| | | Intent intent = new Intent(RegisterActivity.this, BrowserActivity.class); |
| | | Intent intent = new Intent(this, BrowserActivity.class); |
| | | intent.putExtra("url", BeibeiConstant.USER_AGREEMENT); |
| | | startActivity(intent); |
| | | break; |
| | | case R.id.tv_privacy_policy: |
| | | Intent intent1 = new Intent(this, BrowserActivity.class); |
| | | intent1.putExtra("url", BeibeiConstant.PRIVACY_POLICY); |
| | | startActivity(intent1); |
| | | break; |
| | | case R.id.tv_obtain_verfication_code: |
| | | String email = et_email.getText().toString(); |
| | | if (StringUtils.isEmpty(email)) { |
| | |
| | | if (BeibeiConstant.IS_TEST) |
| | | BeibeiConstant.AD_TYPE = null; |
| | | //需要加载广告 |
| | | if (BeibeiConstant.AD_TYPE != null && BeibeiConstant.AD_TYPE.isPlayerAd() && playUrl.getPlayType() != 2) { |
| | | if (BeibeiConstant.AD_TYPE != null && BeibeiConstant.AD_TYPE.isPlayerAd() && playUrl != null && playUrl.getPlayType() != 2) { |
| | | mVideoDetailVideoAdFragment = new PlayVideoPreADFragment(); |
| | | mVideoDetailVideoAdFragment.setPageEventListener(new IPageEventListener() { |
| | | @Override |
| | |
| | | PPTVPlayFragment pptvPlayFragment = new PPTVPlayFragment(); |
| | | Bundle bundle = new Bundle(); |
| | | bundle.putString("playUrl", playUrl); |
| | | bundle.putString("videoId",data.optString("videoId")); |
| | | bundle.putString("videoId", data.optString("videoId")); |
| | | pptvPlayFragment.setArguments(bundle); |
| | | getSupportFragmentManager().beginTransaction().replace(R.id.fl_pptv, pptvPlayFragment).commit(); |
| | | if (progressDialog.isShowing()) { |
| | |
| | | |
| | | import com.androidquery.AQuery; |
| | | import com.lcjian.library.util.common.ClipboardUtil; |
| | | import com.lcjian.library.util.common.StringUtils; |
| | | import com.umeng.analytics.MobclickAgent; |
| | | import com.weikou.beibeivideo.R; |
| | | import com.weikou.beibeivideo.ui.BaseActivity; |
| | |
| | | |
| | | |
| | | case R.id.tv_submit:// 复制QQ号 |
| | | String content = aQuery.id(R.id.et_content).getText() + ""; |
| | | if (StringUtils.isEmpty(content)) { |
| | | Toast.makeText(this, "请填写意见", Toast.LENGTH_SHORT).show(); |
| | | return; |
| | | } |
| | | Toast.makeText(this, "提交成功", Toast.LENGTH_SHORT).show(); |
| | | finish(); |
| | | break; |
| | |
| | | |
| | | private final static int REQUEST_CODE_VIP = 1002; |
| | | |
| | | private int code = -1; |
| | | |
| | | |
| | | private final static String TAG = PPTVPlayFragment.class.getSimpleName(); |
| | | |
| | |
| | | } |
| | | |
| | | private void jumpToVIP() { |
| | | //判断是否登录 |
| | | if (!UserUtil.isLogin(getContext())) { |
| | | Intent intent = new Intent(getContext(), LoginActivity.class); |
| | | startActivity(intent); |
| | | return; |
| | | } |
| | | |
| | | startActivityForResult(new Intent(BeibeiVideoApplication.application, BrowserActivity.class).putExtra("result", true).putExtra("url", ConfigUtil.getVipLink(BeibeiVideoApplication.application)), REQUEST_CODE_VIP); |
| | | code = REQUEST_CODE_VIP; |
| | | } |
| | | |
| | | |
| | |
| | | public void onResume() { |
| | | super.onResume(); |
| | | MobclickAgent.onPageStart("网页"); |
| | | if (code == REQUEST_CODE_VIP) { |
| | | code = -1; |
| | | UserUtil.updateUserInfo(BeibeiVideoApplication.application, new UserUtil.IUserInfoUpdateListener() { |
| | | @Override |
| | | public void noLogin() { |
| | | |
| | | } |
| | | |
| | | @Override |
| | | public void onSuccess() { |
| | | ll_vip_open.post(new Runnable() { |
| | | @Override |
| | | public void run() { |
| | | initData(); |
| | | if (webview != null) |
| | | webview.reload(); |
| | | } |
| | | }); |
| | | } |
| | | |
| | | @Override |
| | | public void onFail(String msg) { |
| | | |
| | | } |
| | | }); |
| | | } |
| | | initData(); |
| | | } |
| | | |
| | |
| | | } |
| | | } |
| | | |
| | | |
| | | @Override |
| | | public void onActivityResult(int requestCode, int resultCode, Intent data) { |
| | | Log.d(TAG, "onActivityResdult:" + requestCode); |
| | |
| | | import org.apache.http.Header; |
| | | import org.json.JSONObject; |
| | | |
| | | import java.lang.reflect.Array; |
| | | import java.lang.reflect.Type; |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | |
| | | |
| | | List<WatchHistoryVO> list = gson.fromJson(data.optJSONArray("list").toString(), type); |
| | | currentPage = page; |
| | | if (voList == null) |
| | | voList = new ArrayList<>(); |
| | | if (page == 1) |
| | | voList.clear(); |
| | | if (list != null && list.size() > 0) { |
| | |
| | | |
| | | import android.app.Activity; |
| | | import android.content.Intent; |
| | | import android.graphics.Color; |
| | | import android.support.annotation.NonNull; |
| | | import android.support.v7.widget.RecyclerView; |
| | | import android.view.LayoutInflater; |
| | |
| | | final VideoAdHolder viewHolder = (VideoAdHolder) holder; |
| | | final ExpressAdContainer ad = videoContent.getAd(); |
| | | viewHolder.fl_ad.removeAllViews(); |
| | | //渲染 |
| | | ExpressAdManager.renderAndFillAd(mContext, ad, viewHolder.fl_ad, new ExpressAdManager.IAdEventListener() { |
| | | @Override |
| | | public void closeAd(ExpressAdContainer ad) { |
| | |
| | | public void onPageFinished(WebView webView, String s) { |
| | | super.onPageFinished(webView, s); |
| | | Log.i(TAG, "onPageFinished:" + s); |
| | | if (playerJSRunnable != null) |
| | | if (playerJSRunnable != null && webview != null) |
| | | webview.removeCallbacks(playerJSRunnable); |
| | | playerJSRunnable = new Runnable() { |
| | | @Override |
| | |
| | | |
| | | params.put("Package", mContext.getPackageName()); |
| | | params.put("Version", version + ""); |
| | | params.put("Device", SystemCommon.getDeviceId(mContext)); |
| | | params.put("Device", BeibeiVideoAPI.getDeviceId(mContext)); |
| | | params.put("Time", System.currentTimeMillis() + ""); |
| | | LinkedHashMap<String, String> map = BeibeiVideoAPI.validateParams(params, mContext); |
| | | |
| | |
| | | |
| | | private int viewType; |
| | | |
| | | private boolean showAd; |
| | | |
| | | public static BaiDuCPUContentFragment newInstance(BaiDuCPUType spinnerItem, int viewType) { |
| | | |
| | | public static BaiDuCPUContentFragment newInstance(BaiDuCPUType spinnerItem, int viewType, boolean showAd) { |
| | | BaiDuCPUContentFragment fragment = new BaiDuCPUContentFragment(); |
| | | Bundle bundle = new Bundle(); |
| | | bundle.putSerializable("item", spinnerItem); |
| | | bundle.putInt("viewType", viewType); |
| | | bundle.putBoolean("showAd", showAd); |
| | | fragment.setArguments(bundle); |
| | | return fragment; |
| | | } |
| | |
| | | if (item == null) |
| | | return; |
| | | viewType = bundle.getInt("viewType"); |
| | | showAd = bundle.getBoolean("showAd", true); |
| | | bundle.clear(); |
| | | mChannelId = item.getId(); |
| | | |
| | |
| | | for (int i = list.size() - 1; i >= 0; i--) { |
| | | if ("ad".equalsIgnoreCase(list.get(i).getType())) { |
| | | list.remove(i--); |
| | | break; |
| | | if (showAd) |
| | | break; |
| | | } |
| | | } |
| | | |
| | |
| | | @Override |
| | | public void onNoAd(String s, int i) { |
| | | onLoadFinish(); |
| | | if (currentPage == 1) { |
| | | nrAdList.clear(); |
| | | adapter.notifyDataSetChanged(); |
| | | } |
| | | } |
| | | |
| | | @Override |
| | |
| | | import java.io.InputStream; |
| | | import java.io.InputStreamReader; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.util.StringTokenizer; |
| | | import java.util.regex.Matcher; |
| | |
| | | return (!Character.isLetter(c) || Character.isUpperCase(c)) ? str |
| | | : new StringBuilder(str.length()).append(Character.toUpperCase(c)).append(str.substring(1)).toString(); |
| | | } |
| | | |
| | | |
| | | public static String toString(List list, String sperator) { |
| | | if (list == null) |
| | | return null; |
| | | String str = ""; |
| | | for (Object obj : list) { |
| | | str += obj + sperator; |
| | | } |
| | | if (str.endsWith(sperator)) |
| | | str = str.substring(0, str.length() - sperator.length()); |
| | | return str; |
| | | } |
| | | } |