@Override public View onCreateView( LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { View v = LayoutInflater.from(getActivity()).inflate(R.layout.fragment_guidepage, container, false); RelativeLayout mRl = (RelativeLayout) v.findViewById(R.id.rl_guidepage_back); Button btn = (Button) v.findViewById(R.id.btn_guidepage_start); if (index == 1) { mRl.setBackgroundResource(R.drawable.page1); } else if (index == 2) { mRl.setBackgroundResource(R.drawable.page2); } else if (index == 3) { mRl.setBackgroundResource(R.drawable.page3); } else { mRl.setBackgroundResource(R.drawable.page4); btn.setVisibility(View.VISIBLE); btn.setOnClickListener( new View.OnClickListener() { @Override public void onClick(View arg0) { Intent intent = new Intent(getActivity(), MainActivity.class); GlApplication.setisFirst(false); startActivity(intent); getActivity().finish(); } }); } return v; }
private void setLayout() { switch (act_tag) { case 1: BTN_back.setImageResource(R.drawable.back_btn); IMG_txt_title.setImageResource(R.drawable.rerun_head_text); Relate_head.setBackgroundResource(R.drawable.clubfriday_app_head_tap); TitleView.setTextColor(getResources().getColor(R.color.Green)); BTN_checkin.setImageResource(R.drawable.check_in_rerun); BTN_comment.setImageResource(R.drawable.comment_rerun); BTN_rerun.setImageResource(R.drawable.rerun_icon); BTN_full.setImageResource(R.drawable.fullscr_green); break; case 2: BTN_back.setImageResource(R.drawable.theseries_back_btn); IMG_txt_title.setImageResource(R.drawable.theseries_head_text); Relate_head.setBackgroundResource(R.drawable.theseries_head_tap); TitleView.setTextColor(getResources().getColor(R.color.DarkGrey)); BTN_checkin.setImageResource(R.drawable.theseries_check_in_btn); BTN_comment.setImageResource(R.drawable.theseries_comment_btn); BTN_rerun.setImageResource(R.drawable.mv_vdo_icon); BTN_full.setImageResource(R.drawable.fullscr_darkbrown); break; case 3: BTN_back.setImageResource(R.drawable.mv_back_btn); IMG_txt_title.setImageResource(R.drawable.mv_head_text); Relate_head.setBackgroundResource(R.drawable.mv_head_tap); TitleView.setTextColor(getResources().getColor(R.color.Brown)); BTN_checkin.setImageResource(R.drawable.check_in_mv_btn); BTN_comment.setImageResource(R.drawable.comment_vdo_btn); BTN_rerun.setImageResource(R.drawable.theseries_icon); BTN_full.setImageResource(R.drawable.fullscr_lightbrown); break; } }
public void initView() { stockPrice = (TextView) findViewById(R.id.stock_price); stockRange = (TextView) findViewById(R.id.stock_range); stockRangePercent = (TextView) findViewById(R.id.stock_range_percent); stockImage = (ImageView) findViewById(R.id.stock_image); stockDesc = (TextView) findViewById(R.id.stock_desc); vipOrder = (LinearLayout) findViewById(R.id.ll_vip_order); toOrder = (LinearLayout) findViewById(R.id.ll_toorder); rlstockinfo = (RelativeLayout) findViewById(R.id.rlstockinfo); toOrder.setOnClickListener( new OnClickListener() { @Override public void onClick(View v) { // TODO Auto-generated method stub } }); float range = Float.parseFloat(priceNow) - Float.parseFloat(priceYes); BigDecimal bigDecimal_2 = new BigDecimal(range); float range_2 = bigDecimal_2.setScale(2, BigDecimal.ROUND_HALF_UP).floatValue(); BigDecimal bigDecimal = new BigDecimal(range / Float.parseFloat(priceYes)); float rangePercent = bigDecimal.setScale(2, BigDecimal.ROUND_HALF_UP).floatValue(); if (range <= 0.0) { // 股票跌 rlstockinfo.setBackgroundResource(R.drawable.bj); } else { // 股票涨 rlstockinfo.setBackgroundResource(R.drawable.bj2); } stockPrice.setText(Float.parseFloat(priceNow) + ""); stockRange.setText(range_2 + ""); stockRangePercent.setText(rangePercent + "%"); }
public void setRadioTheme(int tag) { switch (tag) { case 0: headLayout.setBackgroundResource(R.color.chill_color); leftLine.setBackgroundResource(R.color.chill_color); // imgWave .setImageResource(R.raw.chill_listen_logo); BackBT.setImageResource(R.raw.chill_back_btn); typeButton.setImageResource(R.raw.chill_rerun_logo); break; case 1: headLayout.setBackgroundResource(R.color.hot_color); leftLine.setBackgroundResource(R.color.hot_color); // imgWave .setImageResource(R.raw.hot_listen_logo); BackBT.setImageResource(R.raw.hot_back_btn); typeButton.setImageResource(R.raw.hot_rerun_logo); break; case 2: headLayout.setBackgroundResource(R.color.efm_color); leftLine.setBackgroundResource(R.color.efm_color); // imgWave .setImageResource(R.raw.efm_listen_logo); BackBT.setImageResource(R.raw.efm_back_btn); typeButton.setImageResource(R.raw.efm_rerun_logo); break; case 3: headLayout.setBackgroundResource(R.color.green_color); leftLine.setBackgroundResource(R.color.green_color); // imgWave .setImageResource(R.raw.green_listen_logo); BackBT.setImageResource(R.raw.green_back_btn); typeButton.setImageResource(R.raw.green_rerun_logo); break; } }
private void setSuitableConfiguration() { getControls(); bindControls(); videoViewBackground.setBackgroundColor(0); if (getResources().getConfiguration().orientation == Configuration.ORIENTATION_LANDSCAPE) { horizontalView.setVisibility(View.VISIBLE); verticalView.setVisibility(View.GONE); listView = (ListView) findViewById(R.id.videolist); fullScreenParams = new RelativeLayout.LayoutParams(horizontalView.getLayoutParams()); videoViewBackground.setBackgroundResource(R.drawable.video_back); } else if (getResources().getConfiguration().orientation == Configuration.ORIENTATION_PORTRAIT) { verticalView.setVisibility(View.VISIBLE); horizontalView.setVisibility(View.GONE); fullScreenParams = new RelativeLayout.LayoutParams(verticalView.getLayoutParams()); listView = (ListView) findViewById(R.id.videolistPort); videoViewBackground.setBackgroundResource(R.drawable.port_black); } if (isListVisible) { listVisible(); } else { videoVisible(); } listView.setAdapter(listAdapter); listView.setOnItemClickListener(this); }
@Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); ButterKnife.bind(this); mProgressBar.setVisibility(View.INVISIBLE); // Method call to start running the comunication with the api getForecast(); Log.d(TAG, "Code is running"); mRefreshButton.setOnClickListener( new View.OnClickListener() { @Override public void onClick(View v) { getForecast(); } }); // This code below is used to change the background of our app depending what time is it Date date = new Date(); Calendar cal = Calendar.getInstance(); cal.setTime(date); int hour = cal.get(Calendar.HOUR_OF_DAY); Log.i(TAG, hour + ""); if (hour >= 6 && hour < 12) { mMainLayout.setBackgroundResource(R.drawable.bg_gradient_morning); } else if (hour >= 12 && hour < 19) { mMainLayout.setBackgroundResource(R.drawable.bg_gradient_evening); } else { mMainLayout.setBackgroundResource(R.drawable.bg_gradient_night); } }
public void unselectTab(int position) { mLastTab = position; switch (position) { case 0: mDirectoryImage.setBackgroundResource(R.drawable.ico_nav_directory); mDirectoryText.setTextColor(getResources().getColor(R.color.navbar_text)); mDirectoryButton.setBackgroundResource(android.R.color.transparent); break; case 1: mRequestImage.setBackgroundResource(R.drawable.ico_nav_request); mRequestText.setTextColor(getResources().getColor(R.color.navbar_text)); mRequestButton.setBackgroundResource(android.R.color.transparent); break; case 2: mSendImage.setBackgroundResource(R.drawable.ico_nav_send); mSendText.setTextColor(getResources().getColor(R.color.navbar_text)); mSendButton.setBackgroundResource(android.R.color.transparent); break; case 3: mWalletImage.setBackgroundResource(R.drawable.ico_nav_wallets); mWalletText.setTextColor(getResources().getColor(R.color.navbar_text)); mWalletButton.setBackgroundResource(android.R.color.transparent); break; case 4: mSettingImage.setBackgroundResource(R.drawable.ico_nav_more); mSettingText.setTextColor(getResources().getColor(R.color.navbar_text)); mSettingButton.setBackgroundResource(android.R.color.transparent); break; default: break; } }
public void changeBackground(Background bg) { RelativeLayout layout = (RelativeLayout) view; switch (bg) { case ACCENT: layout.setBackgroundResource(R.color.accent); break; case ACCENT_HALF_TRANSP: layout.setBackgroundResource(R.color.accent_half_transp); break; } }
public void setBack(String cityName) { if (cityName.equals("北京")) { mLayout.setBackgroundResource(R.drawable.biz_plugin_weather_beijin_bg); } else if (cityName.equals("上海")) { mLayout.setBackgroundResource(R.drawable.biz_plugin_weather_shanghai_bg); } else if (cityName.equals("广州")) { mLayout.setBackgroundResource(R.drawable.biz_plugin_weather_guangzhou_bg); } else if (cityName.equals("深圳")) { mLayout.setBackgroundResource(R.drawable.biz_plugin_weather_shenzhen_bg); } else { mLayout.setBackgroundResource(R.drawable.biz_news_local_weather_bg_big); } }
public void OnEventChange() { hotelCode = Handler_SharedPreferences.getValueByName( getActivity(), "hotel", "hotelcode", Handler_SharedPreferences.STRING); Ioc.getIoc().getLogger().e(" OnEventChange hotelCode:" + hotelCode); if ("2".equals(hotelCode)) { // 三亚 home_page.setBackgroundResource(R.drawable.home_page); jzyd.setBackgroundResource(R.drawable.hotel_back); } else { home_page.setBackgroundResource(R.drawable.hotel_page_qd); jzyd.setBackgroundResource(R.drawable.qingdao_bj); } }
public void setChioceItem(int index) { FragmentTransaction transaction = fManager.beginTransaction(); clearChioce(); hideFragments(transaction); switch (index) { case 0: meet_image.setImageResource(R.drawable.ic_tabbar_contacts_pressed); meet_text.setTextColor(blue); meet_layout.setBackgroundResource(R.drawable.ic_tabbar_bg_click); if (fg1 == null) { fg1 = new fg1(); transaction.add(R.id.content, fg1); } else { transaction.show(fg1); } break; case 1: contacts_image.setImageResource(R.drawable.ic_tabbar_contacts_pressed); contacts_text.setTextColor(blue); contacts_layout.setBackgroundResource(R.drawable.ic_tabbar_bg_click); if (fg2 == null) { fg2 = new fg2(); transaction.add(R.id.content, fg2); } else { transaction.show(fg2); } break; case 2: settings_image.setImageResource(R.drawable.ic_tabbar_settings_pressed); settings_text.setTextColor(blue); settings_layout.setBackgroundResource(R.drawable.ic_tabbar_bg_click); if (fg3 == null) { fg3 = new fg3(); transaction.add(R.id.content, fg3); } else { transaction.show(fg3); } break; } transaction.commit(); }
private void setImageSim(RelativeLayout imageSim, SimItem simItem) { if (simItem.mIsSim) { int resColor = GeminiUtils.getSimColorResource(simItem.mColor); if (resColor >= 0) { imageSim.setVisibility(View.VISIBLE); imageSim.setBackgroundResource(resColor); } } else if (simItem.mColor == COLOR_INTERNET_CALL) { imageSim.setVisibility(View.VISIBLE); imageSim.setBackgroundResource(com.mediatek.internal.R.drawable.sim_background_sip); } else { imageSim.setVisibility(View.GONE); } }
private void updateBackground(int direction) { switch (direction) { case 0: layoutDirection.setBackgroundResource(R.drawable.ic_direction_0); break; case 1: layoutDirection.setBackgroundResource(R.drawable.ic_direction_1); break; case 2: layoutDirection.setBackgroundResource(R.drawable.ic_direction_2); break; case 3: layoutDirection.setBackgroundResource(R.drawable.ic_direction_3); break; case 4: layoutDirection.setBackgroundResource(R.drawable.ic_direction_4); break; case 5: layoutDirection.setBackgroundResource(R.drawable.ic_direction_5); break; case 6: layoutDirection.setBackgroundResource(R.drawable.ic_direction_6); break; case 7: layoutDirection.setBackgroundResource(R.drawable.ic_direction_7); break; } }
@Override protected void onCreate(Bundle savedInstanceState) { // TODO Auto-generated method stub super.onCreate(savedInstanceState); setContentView(R.layout.user_friends); m = new Menu(this); sess = new Session(FriendList.this); HashMap<String, String> map = sess.getUserDetails(); idd = map.get(Session.KEY_ID); il = new ImageLoader(FriendList.this); try { HashMap<String, Integer> map2 = sess.getBG(); int st = map2.get(Session.KEY_POS); Log.i("jkkk", "" + st); RelativeLayout rel = (RelativeLayout) findViewById(R.id.rel); rel.setBackgroundResource(icons[st]); } catch (Exception e) { e.printStackTrace(); } list1 = (GridView) findViewById(R.id.gridView1); friend(); IntentFilter intentFilter = new IntentFilter(); intentFilter.addAction("com.package.ACTION_LOGOUT"); registerReceiver(log, intentFilter); }
private void setAoudio() { mContactImageLayout.setBackgroundResource(R.drawable.skinclassic_color_list_top_bot); mContactImage.setBackgroundResource(R.drawable.yms_album_thumb); MmsSlideShowListActivity activity = (MmsSlideShowListActivity) mContext; mhandler = new Handler(); if (activity.getAudioState() == activity.MMS_SLIDE_AUDIO_IDLE || activity.getAudioState() == activity.MMS_SLIDE_AUDIO_PAUSE) { mContactImage.setImageResource(R.drawable.play); } else { mContactImage.setImageResource(R.drawable.pause); } mContactImage.setVisibility(View.VISIBLE); mContactImageLayout.setOnClickListener( new OnClickListener() { @Override public void onClick(View v) { MmsSlideShowListActivity activity = (MmsSlideShowListActivity) mContext; if (activity.getAudioState() == activity.MMS_SLIDE_AUDIO_PLAY) { activity.pauseAudio(); mContactImage.setImageResource(R.drawable.play); } else { activity.startAudio(mData.audioUri); mhandler.postDelayed(mRunnable, 300); mSampleStart = System.currentTimeMillis(); mContactImage.setImageResource(R.drawable.pause); } } }); mContactImageParent.setOnCreateContextMenuListener(mRecipientsMenuCreateListener); }
/** * Sets the color depending on the settings. * * @param rl Layout to set. * @since 0.3 */ public static void setColor(RelativeLayout rl) { switch (Settings.theme) { case BLUE: rl.setBackgroundResource(R.drawable.blue); break; case GREEN: rl.setBackgroundResource(R.drawable.green); break; case ORANGE: rl.setBackgroundResource(R.drawable.orange); break; case PURPLE: rl.setBackgroundResource(R.drawable.purple); break; } }
private synchronized void scheduleSuicide() { if (mTimerSuicide == null) { mRelativeLayout.setBackgroundResource(R.drawable.grad_bkg_termwait); mTimerSuicide = new NgnTimer(); mTimerSuicide.schedule(mTimerTaskSuicide, new Date(new Date().getTime() + 1500)); } }
private void setupHeaderView() { RelativeLayout headerRL = (RelativeLayout) this.findViewById(R.id.headerLayout); headerRL.setBackgroundResource( mEditMode ? R.drawable.alerts_header_background : R.drawable.location_header_background); TextView headerTitleTV = (TextView) headerRL.findViewById(R.id.title_header_TV); Button headerBtn = (Button) headerRL.findViewById(R.id.action_btn); headerBtn.setVisibility(mEditMode ? View.GONE : View.VISIBLE); headerBtn.setText(getResources().getString(mEditMode ? R.string.done : R.string.add_to_alerts)); headerBtn.setOnClickListener( new View.OnClickListener() { @Override public void onClick(View v) { new GoogleAnalyticsUtil() .trackEvents( IndriveApplication.getInstance(), getResources().getString(R.string.category_location), "LocationAddAlerts"); if (validateTime()) { save(); } else { Toast.makeText( LocationAlertsActivity.this, getResources().getString(R.string.time_validate_error), Toast.LENGTH_LONG) .show(); } } }); headerTitleTV.setText( this.getResources() .getString(mEditMode ? R.string.edit_location_alert : R.string.location_alert)); }
/** Called when the activity is first created. */ @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); Crashlytics.start(this); Resize.setup(this, false); context = this; RelativeLayout bgLayout = new RelativeLayout(this); bgLayout.setLayoutParams( new LayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.MATCH_PARENT)); bgLayout.setBackgroundResource(R.drawable.splash_bg); RelativeLayout.LayoutParams params = new RelativeLayout.LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT); params.addRule(RelativeLayout.CENTER_IN_PARENT); splashImageView = new ImageView(this); splashImageView.setLayoutParams(params); splashImageView.setBackgroundResource(R.drawable.splash_logo); bgLayout.addView(splashImageView); setContentView(bgLayout); Handler h = new Handler(); h.postDelayed(this, 2000); }
@Override public View getView(final int position, View convertView, ViewGroup parent) { // TODO Auto-generated method stub Holder holder = new Holder(); View rowView = inflater.inflate(R.layout.analysis_filllevel_item, null); holder.ltxtview = (TextView) rowView.findViewById(R.id.analysisLtxtView); holder.rtxtview = (TextView) rowView.findViewById(R.id.analysisRtxtView); holder.ltxtview.setText(reqMap.getKey(position)); holder.rtxtview.setText(Double.toString(reqMap.getValue(position)) + "%"); RelativeLayout chktxt = (RelativeLayout) rowView.findViewById(R.id.chkTextlayout); if (reqMap.getValue(position) > 80) { chktxt.setBackgroundResource(R.drawable.red_button_border); // holder.rtxtview.startAnimation(AnimationUtils.loadAnimation(context,android.R.anim.slide_out_right)); } else if (reqMap.getValue(position) <= 80 && reqMap.getValue(position) > 50) { chktxt.setBackgroundResource(R.drawable.orange_button_border); } else if (reqMap.getValue(position) <= 50) { chktxt.setBackgroundResource(R.drawable.green_button_border); } CheckBox chk = (CheckBox) rowView.findViewById(R.id.chkAnalysis); chk.setOnClickListener( new View.OnClickListener() { @Override public void onClick(View v) { Log.d("Checked", Integer.toString(position)); } }); // rowView.setOnClickListener(new View.OnClickListener() { // @Override // public void onClick(View v) { // // TODO Auto-generated method stub //// Toast.makeText(context, "You Clicked ", Toast.LENGTH_LONG).show(); // Log.d(TAG, "hi " + " listview listener"); // //Intent intent = new Intent( context, BinDetailsActivity.class); // //startActivity(intent); // } // }); return rowView; }
// bgNumを受け取って背景を変更するメソッド private void num2bg(int bgNum) { switch (bgNum) { case 0: layout.setBackgroundResource(R.drawable.bg_01); break; case 1: layout.setBackgroundResource(R.drawable.bg_02); break; case 2: layout.setBackgroundResource(R.drawable.bg_03); break; case 3: layout.setBackgroundResource(R.drawable.bg_04); break; default: break; } }
public void showPopupWindow(View parent) { BallTextView ball = (BallTextView) parent; if (ball.getColor().equals("red")) { ballLayout.setBackgroundResource(R.drawable.bet_number_popup_red); } else { ballLayout.setBackgroundResource(R.drawable.bet_number_popup_blue); } if (ball.getWord() != null) setText(ball.getWord()); else { setText(String.valueOf(ball.getNumber())); } int location[] = new int[2]; parent.getLocationOnScreen(location); mPopupWindow.setAnimationStyle(R.style.popup_ball); // mPopupWindow.showAtLocation(parent, Gravity.NO_GRAVITY, location[0] - 40, location[1] - 100); // mPopupWindow.showAtLocation(parent, Gravity.NO_GRAVITY, location[0], location[1]); mPopupWindow.showAsDropDown(parent, -9, -ball.getHeight() / 2 * 5); }
private void setBackgroundImage() { RelativeLayout layout = (RelativeLayout) findViewById(R.id.clubResult_background); if (globals.getBackgroundSetting()) { layout.setBackgroundResource(R.drawable.fallbrook_cropped_opaque); } else { layout.setBackgroundColor(Color.WHITE); } }
@Override protected IssueAdapter doInBackground(Void... viewPager) { // TODO Auto-generated method stub ArrayList<View> relativeLayouts = new ArrayList<View>(); RelativeLayout relativeLayout1 = (RelativeLayout) activity.getLayoutInflater().inflate(R.layout.pagerlayout, null); relativeLayout1.setBackgroundResource(R.drawable.issue_1); TextView textView1 = (TextView) relativeLayout1.findViewById(R.id.tv_pagerdesc); textView1.setText("辉煌,走进2002国足"); RelativeLayout relativeLayout2 = (RelativeLayout) activity.getLayoutInflater().inflate(R.layout.pagerlayout, null); relativeLayout2.setBackgroundResource(R.drawable.issue_2); TextView textView2 = (TextView) relativeLayout2.findViewById(R.id.tv_pagerdesc); textView2.setText("秀恩爱,小猪和伊万齐出镜"); RelativeLayout relativeLayout3 = (RelativeLayout) activity.getLayoutInflater().inflate(R.layout.pagerlayout, null); relativeLayout3.setBackgroundResource(R.drawable.issue_3); TextView textView3 = (TextView) relativeLayout3.findViewById(R.id.tv_pagerdesc); textView3.setText("不说足球,中国游泳神话"); RelativeLayout relativeLayout4 = (RelativeLayout) activity.getLayoutInflater().inflate(R.layout.pagerlayout, null); relativeLayout4.setBackgroundResource(R.drawable.issue_4); TextView textView4 = (TextView) relativeLayout4.findViewById(R.id.tv_pagerdesc); textView4.setText("官方,萨拉赫加盟罗马"); RelativeLayout relativeLayout5 = (RelativeLayout) activity.getLayoutInflater().inflate(R.layout.pagerlayout, null); relativeLayout5.setBackgroundResource(R.drawable.issue_6); TextView textView5 = (TextView) relativeLayout5.findViewById(R.id.tv_pagerdesc); textView5.setText("别急!今夏这15大球星仍有可能转会"); relativeLayouts.add(relativeLayout1); relativeLayouts.add(relativeLayout2); relativeLayouts.add(relativeLayout3); relativeLayouts.add(relativeLayout4); relativeLayouts.add(relativeLayout5); issueAdapter = new IssueAdapter(relativeLayouts); return issueAdapter; }
public Call(Context context) { super(context); color = xacInteractiveCanvas.fgColorGreen; CallManager.setPhone(this); appLayout = new RelativeLayout(context); appLayout.setBackgroundColor(xacInteractiveCanvas.bgColorGreen); // dispatchButtons(context); layoutViews = new RelativeLayout(context); appLayout.setOnTouchListener( new View.OnTouchListener() { @Override public boolean onTouch(View view, MotionEvent event) { posture = xacPostureSenseFeatureMaker.calculatePosture(); if (posture != xacPostureSenseFeatureMaker.NOWATCH) { return false; } return true; } }); layoutViews.setId(42); appLayout.addView(layoutViews); dispatchViews(context); layoutCallScreen = new RelativeLayout(context); layoutCallScreen.setBackgroundColor(0xDD000000); layoutCallScreen.setBackgroundResource(R.drawable.call_out); layoutCallScreen.setOnTouchListener( new View.OnTouchListener() { @Override public boolean onTouch(View v, MotionEvent event) { posture = xacPostureSenseFeatureMaker.calculatePosture(); if (posture == xacPostureSenseFeatureMaker.NONE) { if (event.getAction() == MotionEvent.ACTION_UP) { layoutCallScreen.setBackgroundColor(0xDD000000); appLayout.removeView(layoutCallScreen); isCalling = false; isInApp = false; } } else if (posture == xacPostureSenseFeatureMaker.NOWATCH) { doTouch(event); } return true; } }); sup = "5 missed calls from Tiffany"; }
@Override public boolean onTouch(View v, MotionEvent event) { // TODO Auto-generated method stub if (event.getAction() == MotionEvent.ACTION_DOWN) { rl_back.setBackgroundResource(R.drawable.abs__list_focused_holo); } else { rl_back.setBackground(null); finish(); } return true; }
@Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); fManager = getSupportFragmentManager(); initViews(); meet_image.setImageResource(R.drawable.ic_tabbar_contacts_pressed); meet_text.setTextColor(blue); meet_layout.setBackgroundResource(R.drawable.ic_tabbar_bg_click); onClick(meet_layout); }
private void createBottomBanner(Context context) { mBottomBanner = new RelativeLayout(this.getContext()); mBottomBanner.setBackgroundResource(R.drawable.stone_bg); RelativeLayout.LayoutParams bottomBannerLP = new RelativeLayout.LayoutParams( RelativeLayout.LayoutParams.FILL_PARENT, RelativeLayout.LayoutParams.WRAP_CONTENT); bottomBannerLP.width = LayoutUtil.getNavigationPanelWidth(); bottomBannerLP.height = LayoutUtil.getGalleryBottomPanelHeight(); bottomBannerLP.addRule(RelativeLayout.ALIGN_PARENT_BOTTOM); this.addView(mBottomBanner, bottomBannerLP); }
@SuppressWarnings("deprecation") private void inui() throws AppException { // TODO Auto-generated method stub String loadTime = user.getString("url", ""); if (loadTime.equals("")) { mainLayout.setBackgroundResource(R.drawable.ic_mainbg2); } else { if (loadTime.startsWith("sd:")) { loadTime = loadTime.substring(3); mainLayout.setBackground(new BitmapDrawable(BitmapFactory.decodeFile(loadTime))); } else { try { mainLayout.setBackground( new BitmapDrawable(BitmapFactory.decodeStream(getAssets().open(loadTime)))); } catch (IOException e) { e.printStackTrace(); } } } Reminds reminds = null; if (!remindfzDB.select().equals("")) { reminds = Reminds.parse(remindfzDB.select()); for (int i = 0; i < reminds.getFileList().size(); i++) { remindfs.add(reminds.getFileList().get(i)); } } if (remindfs.size() == 0) { rels.setVisibility(View.INVISIBLE); } else { fsize.setText(String.valueOf(remindfs.size())); } if (!remindzjDB.select().equals("")) { reminds = Reminds.parse(remindzjDB.select()); for (int i = 0; i < reminds.getFileList().size(); i++) { remindzj.add(reminds.getFileList().get(i)); } } if (remindzj.size() == 0) { rels1.setVisibility(View.INVISIBLE); } else { hsize.setText(String.valueOf(remindzj.size())); } if (!remindnewsDB.select().equals("")) { reminds = Reminds.parse(remindnewsDB.select()); for (int i = 0; i < reminds.getFileList().size(); i++) { remindnews.add(reminds.getFileList().get(i)); } } if (remindnews.size() == 0) { rels2.setVisibility(View.INVISIBLE); } else { nsize.setText(String.valueOf(remindnews.size())); } }
/** * @Description: 创建动画层 * * @param * @return void * @throws */ private ViewGroup createAnimLayout() { ViewGroup rootView = (ViewGroup) ((Activity) getContext()).getWindow().getDecorView(); RelativeLayout animLayout = new RelativeLayout(getContext()); RelativeLayout.LayoutParams lp = new RelativeLayout.LayoutParams( RelativeLayout.LayoutParams.FILL_PARENT, RelativeLayout.LayoutParams.FILL_PARENT); animLayout.setLayoutParams(lp); animLayout.setBackgroundResource(android.R.color.transparent); rootView.addView(animLayout); return animLayout; }