Example #1
0
  private void initializeComponent() {
    imgPlay = (ImageView) findViewById(R.id.imgPlay);
    imgPlay.setOnClickListener(PlayActivity.this);
    imgSpeaker = (ImageView) findViewById(R.id.imgSpeaker);
    imgSpeaker.setOnClickListener(PlayActivity.this);
    txtCurrenDuration = (TextView) findViewById(R.id.txtCurrentDuration);
    txtTotalDuration = (TextView) findViewById(R.id.txtTotalDuration);
    txtSongTitle = (TextView) findViewById(R.id.txtSongTitle);
    txtSongTitle.setSelected(true);
    txtArtist = (TextView) findViewById(R.id.txtArtist);
    seekBar = (SeekBar) findViewById(R.id.seekBar);
    seekBar.setOnSeekBarChangeListener(
        new SeekBar.OnSeekBarChangeListener() {
          @Override
          public void onProgressChanged(SeekBar seekBar, int progress, boolean fromUser) {
            if (fromUser) {
              if (isPlaying) {
                mediaPlayer.seekTo(progress * 1000);
              }
            }
          }

          @Override
          public void onStartTrackingTouch(SeekBar seekBar) {}

          @Override
          public void onStopTrackingTouch(SeekBar seekBar) {}
        });
  }
Example #2
0
  @Override
  public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.menu);

    layoutInflater = this.getLayoutInflater();
    // overridePendingTransition(android.R.anim.slide_in_left,android.R.anim.slide_out_right);
    // startService(new Intent(this, LocationService.class));
    GridView gridView = (GridView) findViewById(R.id.gridView);
    gridView.setOnItemClickListener(itemClickListener);
    gridView = (GridView) findViewById(R.id.gridView);
    gridView.setAdapter(new ImageAdapter(this));

    peopleNearByIcon = (ImageView) findViewById(R.id.peopleNearByNotification);
    peopleNearByIcon.setOnClickListener(this);
    friendRequestsIcon = (ImageView) findViewById(R.id.friendRequestNotification);
    friendRequestsIcon.setOnClickListener(this);

    nameText = (TextView) findViewById(R.id.userName);
    nameText.setOnClickListener(this);
    userImage = (ImageView) findViewById(R.id.userImage);
    userImage.setOnClickListener(this);
    updateImageNameStrip();
    if (pd != null) pd.dismiss();

    // VISH
    Intent i = new Intent(getApplicationContext(), NotificationService.class);
    startService(i);
  }
  private void initView() {

    mImgFollowMe = (ImageView) findViewById(R.id.image_notice);
    mImgFollowMe.setOnClickListener(
        new View.OnClickListener() {
          @Override
          public void onClick(View v) {
            if (!isCatch) {
              catchMeRequest();
            } else {
              dropCatch();
            }
          }
        });
    // mImgFav = (ImageView) findViewById(R.id.image_fav);
    // mImgFav.setImgStateChangeListener(this);

    mRadioGroup = (FlowRadioGroup) this.findViewById(R.id.video_detail_radiogroup);
    mRadioGroup.setOnCheckedChangeListener(mRadioCheckedChangeListener);
    mRadioGroup.getRadioButton(0).setChecked(true);
    bar = (ProgressBar) findViewById(R.id.videoplayerPreloader);
    video_down_layout = (RelativeLayout) findViewById(R.id.video_down_layoutx);
    mVideoView = (cn.fxdata.tv.view.video.FullScreenVideoView) findViewById(R.id.video_viewx);
    mDownloadImage = (ImageView) findViewById(R.id.image_download);
    mDownloadImage.setOnClickListener(this);
    btnShare = (ImageView) findViewById(R.id.image_share);
    btnShare.setOnClickListener(this);
    image_fav = (ImageView) findViewById(R.id.image_fav);
    image_fav.setOnClickListener(this);
  }
Example #4
0
  public View getView(final int position, View convertView, ViewGroup parent) {
    // Log.i(TAG, "getView, position:" + position);
    if (position >= mListView.size()) {
      return null;
    }

    convertView = mListView.get(position);

    ImageView editImageView = (ImageView) convertView.findViewById(R.id.editImageView);
    editImageView.setTag(convertView);
    ImageView deleteImageView = (ImageView) convertView.findViewById(R.id.deleteImageView);
    deleteImageView.setTag(convertView);
    editImageView.setOnClickListener(
        new OnClickListener() {
          @Override
          public void onClick(View arg0) {
            View parent = (View) arg0.getTag();
            int index = (Integer) parent.getTag();
            editItem(index);
          }
        });
    deleteImageView.setOnClickListener(
        new OnClickListener() {
          @Override
          public void onClick(View arg0) {
            View parent = (View) arg0.getTag();
            int index = (Integer) parent.getTag();
            deleteItem(index);
          }
        });

    return convertView;
  }
  public void init() {
    context = ZhaopinDetailActivity.this;

    title_left = (ImageView) findViewById(R.id.common_title_left);
    title_right = (ImageView) findViewById(R.id.common_title_right);
    title_mid = (TextView) findViewById(R.id.common_title_mid);
    title_left.setOnClickListener(this);
    title_right.setOnClickListener(this);

    wv = (WebView) findViewById(R.id.wv);

    progress = (ProgressBar) findViewById(R.id.progress);

    ZhaopinDetailBean temp =
        ZhaopinDBHelper.getInstance(context).getZhaopin(zhaopinbasebean.getUrl());
    if (temp == null) {
      store = false;
      handler.sendEmptyMessage(UNCHOOSE);
    } else {
      store = true;
      handler.sendEmptyMessage(CHOOSE);
      zhaopindetailbean = temp;
    }
    if (store) {
      wv.loadData(zhaopindetailbean.getContent(), "text/html", "UTF-8");
    } else {
      getData(zhaopinbasebean);
    }
  }
  @Override
  public View getView(int position, View convertView, ViewGroup parent) {
    int type = getItemViewType(position);
    if (convertView == null) {
      if (type == 0) {
        convertView = mInflater.inflate(R.layout.item_op, null);
      } else if (type == MediaEntity.IMAGE) {
        convertView = mInflater.inflate(R.layout.item_grid, null);
      } else if (type == MediaEntity.AUDIO) {
        convertView = mInflater.inflate(R.layout.item_grid, null);
      } else if (type == MediaEntity.VIDEO) {
        convertView = mInflater.inflate(R.layout.item_grid_video, null);
      } else {
        throw new IllegalArgumentException("no this kind of viewType");
      }
    }

    int folderType = mDataFolder.getType();
    if (position == 0) {
      ImageView img = (ImageView) convertView;
      if (folderType == MediaEntity.IMAGE) {
        img.setImageResource(R.mipmap.img_op_camera);
        img.setOnClickListener(v -> mActivity.toTakePhoto());
      } else if (type == MediaEntity.VIDEO) {
        img.setImageResource(R.mipmap.img_op_video);
        img.setOnClickListener(v -> mActivity.toMakeVideo());
      }
    } else {
      ImageView imgCover = (ImageView) convertView.findViewById(R.id.img);
      ImageView imgCheck = (ImageView) convertView.findViewById(R.id.img_check_box);
      int realPosition = position - 1;
      MediaEntity en = mDada.get(realPosition);
      imgCheck.setSelected(mediaManager.isSelected(en));
      imgCheck.setOnClickListener(v1 -> mediaManager.toggle(en));

      Glide.with(mActivity).load(en.getPath()).crossFade().into(imgCover);
      if (type == MediaEntity.IMAGE) {
        imgCover.setOnClickListener(
            v -> {
              if (mOnMediaClickListener == null) {
                ActivityImageShower.startActivity(mActivity, mDataFolder, realPosition);
              } else {
                mOnMediaClickListener.onMediaClick(en, realPosition);
              }
            });
      } else if (type == MediaEntity.VIDEO) {
        TextView txtTime = (TextView) convertView.findViewById(R.id.txt_time);
        txtTime.setText(getSecond(en.getDuration()));
        imgCover.setOnClickListener(
            v -> {
              if (mOnMediaClickListener == null) {
                ActivityVideoShower.startActivity(mActivity, en);
              } else {
                mOnMediaClickListener.onMediaClick(en, realPosition);
              }
            });
      }
    }
    return convertView;
  }
Example #7
0
  private void initView() {

    FragmentTransaction transaction = getFragmentManager().beginTransaction();
    transaction.add(R.id.fragment1, new NaviStart3Activity());
    transaction.add(R.id.fragment2, new MusicPlayer());
    transaction.commit();

    rll1 = (MyRelaLayout) findViewById(R.id.rll1);
    rll2 = (MyRelaLayout) findViewById(R.id.rll2);
    rll2.setStyle(1);
    rll1.inputActivity(this);
    rll2.inputActivity(this);
    params1 = rll1.getLayoutParams();
    params2 = rll2.getLayoutParams();

    ViewTreeObserver observer = findViewById(R.id.main).getViewTreeObserver();
    observer.addOnGlobalLayoutListener(
        new ViewTreeObserver.OnGlobalLayoutListener() {
          @Override
          public void onGlobalLayout() {
            findViewById(R.id.main).getViewTreeObserver().removeOnGlobalLayoutListener(this);
            int h = getWindow().findViewById(Window.ID_ANDROID_CONTENT).getHeight();
            height = h;
            params1.height = rll1.getHeight();
            params2.height = rll2.getHeight();
          }
        });

    img0 = (ImageView) findViewById(R.id.img0);
    img1 = (ImageView) findViewById(R.id.img1);
    img0.setOnClickListener(this);
    img1.setOnClickListener(this);
  }
  @Override
  public View onCreateView(
      LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
    View view = inflater.inflate(R.layout.fragment_selection_leg_right, container, false);

    imgLegFront = (ImageView) view.findViewById(R.id.imgLegRightFront);
    imgLegBack = (ImageView) view.findViewById(R.id.imgLegRightBack);
    imgFootTop = (ImageView) view.findViewById(R.id.imgFootRightTop);
    imgFootDown = (ImageView) view.findViewById(R.id.imgFootRightDown);

    imgLegBack.setOnClickListener(this);
    imgLegFront.setOnClickListener(this);
    imgFootTop.setOnClickListener(this);
    imgFootDown.setOnClickListener(this);

    ImageDrawer.drawPointsOfBodyPart(
        imgLegFront, SpecificBodyPart.RIGHT_LEG_FRONT, R.drawable.perna_esquerda_frente);
    ImageDrawer.drawPointsOfBodyPart(
        imgLegBack, SpecificBodyPart.RIGHT_LEG_BACK, R.drawable.perna_esquerda_atras);
    ImageDrawer.drawPointsOfBodyPart(
        imgFootDown, SpecificBodyPart.RIGHT_FOOT_DOWN, R.drawable.pe_esquerdo_baixo);
    ImageDrawer.drawPointsOfBodyPart(
        imgFootTop, SpecificBodyPart.RIGHT_FOOT_TOP, R.drawable.pe_esquerdo_cima);

    return view;
  }
Example #9
0
  private void viewSetup() {
    setRoleAssignmentText(mClientGameStateController.getCurrentGameState().assignment);
    mShowDetailsView.setOnTouchListener(
        new View.OnTouchListener() {
          @Override
          public boolean onTouch(View view, MotionEvent motionEvent) {
            if (motionEvent.getAction() == MotionEvent.ACTION_DOWN) {
              mShowDetailsView.setAlpha(0f);
            } else if (motionEvent.getAction() == MotionEvent.ACTION_UP) {
              mShowDetailsView.setAlpha(1f);
            }
            return true;
          }
        });

    mNoButton.setOnClickListener(
        new View.OnClickListener() {
          @Override
          public void onClick(View view) {
            mClientGameStateController.processClientResponse(false);
            mUiChangedListener.notifyDataChanged();
          }
        });

    mYesButton.setOnClickListener(
        new View.OnClickListener() {
          @Override
          public void onClick(View view) {
            mClientGameStateController.processClientResponse(true);
            mUiChangedListener.notifyDataChanged();
          }
        });
  }
  private void initView() {
    ((TextView) findViewById(R.id.title))
        .setText(getResources().getString(R.string.putao_calendar_title));

    findViewById(R.id.back_layout).setOnClickListener(this);

    mDateTView = (TextView) findViewById(R.id.calendar_date);
    mLeftImgView = (ImageView) findViewById(R.id.calendar_left);
    mRightImgView = (ImageView) findViewById(R.id.calendar_right);
    mLeftImgView.setOnClickListener(this);
    mRightImgView.setOnClickListener(this);

    mWeekTagGridView = (MyGridView) findViewById(R.id.gridView_week);
    mWeekTagGridView.setAdapter(new CalendarAdapter(this, false));

    mCalendarGridView = (MyGridView) findViewById(R.id.gridView_calendar);
    mCalendarGridView.setOnItemClickListener(this);
    mCalendarAdapter = new CalendarAdapter(this, true);
    mCalendarAdapter.setInAndOutDate(mLastInCalendarModel, mLastOutCalendarModel);

    if (mDateType == CalendarBean.MODEL_TRAIN_START) {
      mCalendarAdapter.setTrainStartDate(
          mLastTrainCalendarModel, today, tomorrow, afterTomorrow); // modify by lisheng 2014-12-15
    }

    mCalendarGridView.setAdapter(mCalendarAdapter);
    mCalendarAdapter.showDate(this);
  }
Example #11
0
  @Override
  protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_new_game);
    Typeface typeface = Typeface.createFromAsset(getAssets(), "fonts/PoiretOne-Regular.ttf");
    TextView titleTextView = (TextView) findViewById(R.id.new_game_title);
    titleTextView.setTypeface(typeface);

    final ImageView leftImage = (ImageView) findViewById(R.id.select_left_image_view);
    final ImageView rightImage = (ImageView) findViewById(R.id.select_right_image_view);
    leftImage.setPadding(1, 1, 1, 1);
    rightImage.setPadding(1, 1, 1, 1);

    leftSelected = true;
    leftImage.setBackgroundColor(getResources().getColor(R.color.red));
    rightImage.setBackgroundColor(getResources().getColor(R.color.transparent));

    leftImage.setOnClickListener(
        new View.OnClickListener() {
          @Override
          public void onClick(View v) {
            leftSelected = true;
            leftImage.setBackgroundColor(getResources().getColor(R.color.red));
            rightImage.setBackgroundColor(getResources().getColor(R.color.transparent));
          }
        });
    rightImage.setOnClickListener(
        new View.OnClickListener() {
          @Override
          public void onClick(View v) {
            leftSelected = false;
            leftImage.setBackgroundColor(getResources().getColor(R.color.transparent));
            rightImage.setBackgroundColor(getResources().getColor(R.color.blue));
          }
        });

    Button startButton = (Button) findViewById(R.id.finishButton);
    startButton.setTypeface(typeface);

    startButton.setOnClickListener(
        new View.OnClickListener() {
          @Override
          public void onClick(View v) {
            SharedPreferences sharedPref =
                getSharedPreferences(Constants.SHARED_PREFERENCE, MODE_PRIVATE);
            SharedPreferences.Editor editor = sharedPref.edit();

            editor.putString(getString(R.string.self_instance_id), leftSelected ? "Tom" : "Jerry");
            editor.putString(getString(R.string.self_base_instance_id), leftSelected ? "X" : "Y");
            editor.putString(
                getString(R.string.opponent_instance_id), leftSelected ? "Jerry" : "Tom");
            editor.putString(
                getString(R.string.opponent_base_instance_id), leftSelected ? "Y" : "X");
            editor.commit();

            setResult(RESULT_OK);
            finish();
          }
        });
  }
  /** Called when the activity is first created. */
  @Override
  public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.my_calendar_view);

    _calendar = Calendar.getInstance(Locale.getDefault());
    month = _calendar.get(Calendar.MONTH) + 1;
    year = _calendar.get(Calendar.YEAR);
    Log.d(tag, "Calendar Instance:= " + "Month: " + month + " " + "Year: " + year);

    selectedDayMonthYearButton = (Button) this.findViewById(R.id.selectedDayMonthYear);
    selectedDayMonthYearButton.setText("Selected: ");

    prevMonth = (ImageView) this.findViewById(R.id.prevMonth);
    prevMonth.setOnClickListener(this);

    currentMonth = (TextView) this.findViewById(R.id.currentMonth);
    currentMonth.setText(DateFormat.format(dateTemplate, _calendar.getTime()));

    nextMonth = (ImageView) this.findViewById(R.id.nextMonth);
    nextMonth.setOnClickListener(this);

    calendarView = (GridView) this.findViewById(R.id.calendar);

    // Initialised
    adapter = new GridCellAdapter(getApplicationContext(), R.id.calendar_day_gridcell, month, year);
    adapter.notifyDataSetChanged();
    calendarView.setAdapter(adapter);
  }
  private void initView() {
    View.inflate(getContext(), R.layout.ec_call_control_layout, this);
    // 来电显示界面
    mIncomingCallLayout = (LinearLayout) findViewById(R.id.incoming_call_bottom_show);
    mCallCancel = (ImageButton) findViewById(R.id.layout_call_cancel);
    mCallAccept = (ImageButton) findViewById(R.id.layout_call_accept);
    mCallAccept.setOnClickListener(this);
    mCallCancel.setOnClickListener(this);

    // 通话进行过程中显示
    mCallingshowPanel = (LinearLayout) findViewById(R.id.calling_bottom_show);
    // 通话控制按钮区域
    mCallSetupLayout = (RelativeLayout) findViewById(R.id.call_mute_container);
    mCallMute = (ImageView) findViewById(R.id.layout_call_mute);
    mCallHandFree = (ImageView) findViewById(R.id.layout_call_handfree);

    mCallHandFree.setClickable(true);
    mCallMute.setClickable(true);
    mCallHandFree.setOnClickListener(l);
    mCallMute.setOnClickListener(l);

    mCallTransfer = (ImageView) findViewById(R.id.layout_call_transfer);

    // 挂断电话按钮
    mCallRelease = (ImageButton) findViewById(R.id.layout_call_release);
    mCallRelease.setOnClickListener(this);
  }
  @Override
  protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setTranslucentStatus();
    setContentView(R.layout.activity_hot__commodity_detail);
    // 动态注册广播
    //        intentFilter = new IntentFilter("android.net.conn.CONNECTIVITY_CHANGE");
    //        myBroadcastReceiver = new MyBroadcastReceiver();
    //        registerReceiver(myBroadcastReceiver, intentFilter);
    commodityDetail_action_back = (ImageView) findViewById(R.id.commodityDetail_action_back);
    commodityDetail_menu_share = (ImageView) findViewById(R.id.commodityDetail_menu_share);
    commodityDetail_action_back.setOnClickListener(this);
    commodityDetail_menu_share.setOnClickListener(this);
    getSupportActionBar().hide();
    Intent intent = getIntent();
    Bundle extras = intent.getExtras();
    Hot_CommodityDetail_Fragment hot_commodityDetail_fragment = new Hot_CommodityDetail_Fragment();

    getSupportFragmentManager()
        .beginTransaction()
        .replace(R.id.Hot_CommodityDetailActivity_frameLayout, hot_commodityDetail_fragment)
        .commit();
    if (extras != null) {
      hot_commodityDetail_fragment.setArguments(extras);
    }
  }
 public ViewHolder(View view) {
   super(view);
   mTextViewDietplanName =
       (TextView)
           view.findViewById(R.id.fragment_diet_dietplanlist_cardview_textview_dietplanname);
   mTextViewDescription =
       (TextView)
           view.findViewById(R.id.fragment_diet_dietplanlist_cardview_textview_description);
   mTextViewAmountDays =
       (TextView)
           view.findViewById(R.id.fragment_diet_dietplanlist_cardview_textview_amountdays);
   mTextViewAmountMeals =
       (TextView)
           view.findViewById(R.id.fragment_diet_dietplanlist_cardview_textview_amountmeals);
   mTextViewEnergyKcal =
       (TextView)
           view.findViewById(R.id.fragment_diet_dietplanlist_cardview_textview_energykcal);
   mImageViewPinAsCurrent =
       (ImageView)
           view.findViewById(R.id.fragment_diet_dietplanlist_cardview_imagebutton_pinascurrent);
   mImageViewPinAsCurrent.setOnClickListener(this);
   mImageViewSettings =
       (ImageView)
           view.findViewById(R.id.fragment_diet_dietplanlist_cardview_imageview_settings);
   mImageViewSettings.setOnClickListener(this);
   mCardView = (CardView) view.findViewById(R.id.fragment_diet_dietplanlist_cardview);
   mCardView.setOnClickListener(this);
   context = view.getContext();
 }
Example #16
0
  private void setListener() {

    goback.setOnClickListener(
        new OnClickListener() {
          @Override
          public void onClick(View v) {
            System.out.println("返回键");
          }
        });
    help.setOnClickListener(
        new OnClickListener() {
          @Override
          public void onClick(View v) {
            System.out.println("帮助");
          }
        });
    login.setOnClickListener(
        new OnClickListener() {
          @Override
          public void onClick(View v) {
            System.out.println("登录");
            MiddleManager.getInstance().changeUI(SecondUI.class);
          }
        });
  }
Example #17
0
 private void initControls() {
   // init
   mContainer = (RelativeLayout) findViewById(R.id.activity_scan_code_capture_containter);
   mCropLayout = (RelativeLayout) findViewById(R.id.activity_scan_code_capture_crop_layout);
   mEditOrder = (EditText) findViewById(R.id.activity_scan_code_et_bar_code);
   Button mBtnAddOrder = (Button) findViewById(R.id.activity_scan_code_bt_add);
   Button mBtnLookOrder = (Button) findViewById(R.id.activity_scan_code_bt_look);
   Button mBtnOrderComplete = (Button) findViewById(R.id.activity_scan_code_bt_complete);
   mTextScanCount = (TextView) findViewById(R.id.activity_scan_code_tv_scan_order_count);
   mTextOrderNum = (TextView) findViewById(R.id.activity_scan_code_tv_scan_order_number);
   TextView mTextTitle = (TextView) findViewById(R.id.common_view_title_text);
   ImageView mImgBack = (ImageView) findViewById(R.id.common_view_title_img);
   mImgFlash = (ImageView) findViewById(R.id.common_view_title_img_menu);
   // init ui data;
   mEditOrder.setHint(String.format(getString(R.string.barcode_hint), PreferencesUtil.ordtitle));
   mEditOrder.setTransformationMethod(new AllCapTransformationMethod());
   mEditOrder.setKeyListener(new MyNumberKeyListener());
   mBtnLookOrder.setText(
       String.format(getString(R.string.barcode_record), PreferencesUtil.ordtitle));
   mTextTitle.setText(mNewOrder.getBtnname());
   mImgFlash.setVisibility(View.VISIBLE);
   LayoutParams lp = mImgFlash.getLayoutParams();
   lp.width = UtilsAndroid.UI.dip2px(this, 40);
   lp.height = UtilsAndroid.UI.dip2px(this, 40);
   mImgFlash.setLayoutParams(lp);
   mImgFlash.setImageResource(R.drawable.flash_light_white);
   mTextScanCount.setText(
       String.format(getString(R.string.barcode_total), PreferencesUtil.ordtitle, 0));
   // init ui listener;
   mImgBack.setOnClickListener(this);
   mBtnAddOrder.setOnClickListener(this);
   mImgFlash.setOnClickListener(this);
   mBtnLookOrder.setOnClickListener(this);
   mBtnOrderComplete.setOnClickListener(this);
 }
  /** Called when the activity is first created. */
  @Override
  public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    prefs = this.getSharedPreferences("AFF", MODE_PRIVATE);
    requestWindowFeature(Window.FEATURE_NO_TITLE);

    setContentView(R.layout.title_page);

    checkLogin();

    logStatus = (ImageView) findViewById(R.id.title_login_image);
    if (mIsLogin) logStatus.setImageResource(R.drawable.login);
    else logStatus.setImageResource(R.drawable.logout);

    logStatus.setOnClickListener(logStatusListener);

    TextView mTitleText = (TextView) findViewById(R.id.title_title);
    mTitleText.setText("Annenberg Friend Finder");

    TextView mBottomText = (TextView) findViewById(R.id.welcomeTitle);
    if (mIsLogin) {
      mBottomText.setText("Hi, " + prefs.getString("n", "") + ".");
    } else mBottomText.setText("Not logged in.");

    ImageView friendfinder = (ImageView) findViewById(R.id.title_friendfinder);
    friendfinder.setOnClickListener(friendFinderListener);
    ImageView menu = (ImageView) findViewById(R.id.title_menu);
    menu.setOnClickListener(menuListener);
    ImageView schedule = (ImageView) findViewById(R.id.title_schedule);
    schedule.setOnClickListener(scheduleListener);

    masterRow = (LinearLayout) findViewById(R.id.master_row);
    // Button recoverCards = (Button) findViewById(R.id.title_recovercards);
    // recoverCards.setOnClickListener(recoverCardsListener);
  }
Example #19
0
  @Override
  public void updateUi() {
    try {
      path_to_cover_image =
          ((FragmentListener) a).getPixelKnot().has(Keys.COVER_IMAGE_NAME)
              ? ((FragmentListener) a).getPixelKnot().getString(Keys.COVER_IMAGE_NAME)
              : null;
    } catch (JSONException e) {
      Log.e(Logger.UI, e.toString());
      e.printStackTrace();
    }

    if (path_to_cover_image == null) {
      cover_image_file = null;
      cover_image_uri = null;
      cover_image_holder.setImageResource(blank_image);
    } else {
      setImageData();
    }

    if (!((FragmentListener) a).getHasSuccessfullyEmbed()) {
      cover_image_holder.setOnClickListener(choose_picture_listener);
    } else {
      cover_image_holder.setOnClickListener(null);
    }
  }
Example #20
0
  private void initUI() {
    mi = new MenuInflater(this);
    layout_body_activity = (LinearLayout) findViewById(R.id.bodylayout);

    img_recent_chat = (ImageView) findViewById(R.id.tab1);
    img_recent_chat.setOnClickListener(this);
    img_friend_list = (ImageView) findViewById(R.id.tab2);
    img_friend_list.setOnClickListener(this);
    img_group_friend = (ImageView) findViewById(R.id.tab3);
    img_group_friend.setOnClickListener(this);

    myHeadImage = (ImageView) findViewById(R.id.friend_list_myImg);
    myName = (TextView) findViewById(R.id.friend_list_myName);

    cursor = (ImageView) findViewById(R.id.tab2_bg);

    // myHeadImage.setImageResource(imgs[list.get(0).getImg()]);
    myName.setText(list.get(0).getUserName());
    layout_body_activity.setFocusable(true);

    mPager = (ViewPager) findViewById(R.id.viewPager);
    mListViews = new ArrayList<View>();
    LayoutInflater inflater = LayoutInflater.from(this);
    View lay1 = inflater.inflate(R.layout.tab11, null);
    View lay2 = inflater.inflate(R.layout.tab22, null);
    View lay3 = inflater.inflate(R.layout.tab33, null);
    mListViews.add(lay1);
    mListViews.add(lay2);
    mListViews.add(lay3);
    mPager.setAdapter(new MyPagerAdapter(mListViews));
    mPager.setCurrentItem(PAGE2);
    mPager.setOnPageChangeListener(new MyOnPageChangeListener());

    // 下面是最近会话界面处理
    mRecentListView = (ListView) lay1.findViewById(R.id.tab1_listView);
    // mRecentAdapter = new RecentChatAdapter(FriendListActivity.this,
    // application.getmRecentList());// 从全局变量中获取最近聊天对象数组
    mRecentListView.setAdapter(application.getmRecentAdapter()); // 先设置空对象,要么从数据库中读出

    // 下面是处理好友列表界面处理
    // myListView = (MyListView) lay2.findViewById(R.id.tab2_listView);
    myExAdapter = new MyExAdapter(this, group);
    myListView.setAdapter(myExAdapter);
    myListView.setGroupIndicator(null); // 不设置大组指示器图标,因为我们自定义设置了
    myListView.setDivider(null); // 设置图片可拉伸的
    myListView.setFocusable(true); // 聚焦才可以下拉刷新

    // 2015
    myListView.setonRefreshListener(new MyRefreshListener());

    // 下面是群组界面处理
    mGroupListView = (ListView) lay3.findViewById(R.id.tab3_listView);
    List<GroupEntity> groupList = new ArrayList<GroupEntity>();
    GroupEntity entity = new GroupEntity(0, "C175地带", "怀念高中生活...");
    GroupEntity entity2 = new GroupEntity(0, "Android开发", "爱生活...爱Android...");
    groupList.add(entity);
    groupList.add(entity2);
    GroupAdapter adapter = new GroupAdapter(this, groupList);
    mGroupListView.setAdapter(adapter);
  }
Example #21
0
 @Override
 protected void onCreate(android.os.Bundle savedInstanceState) {
   super.onCreate(savedInstanceState);
   setContentView(R.layout.extra_lesson);
   context = this;
   overridePendingTransition(R.anim.movereturn, 0);
   imgvol = (ImageView) findViewById(R.id.imgELvol);
   imgvol.setOnClickListener(this);
   imgSLexer = (ImageView) findViewById(R.id.imgELexer);
   imgSLexer.setOnClickListener(this);
   imgSLtest = (ImageView) findViewById(R.id.imgELtest);
   imgSLtest.setOnClickListener(this);
   tvExtra_content = (TextView) findViewById(R.id.tvExtra_content);
   tvExtra_lesson = (TextView) findViewById(R.id.tvExtra_lesson);
   imgstory = (ImageView) findViewById(R.id.imgELextra);
   imgstory.setOnClickListener(this);
   imgS = (ImageView) findViewById(R.id.imgE);
   String image = "icon4";
   int drawableResourceId =
       this.getResources().getIdentifier(image, "drawable", this.getPackageName());
   imgS.setImageResource(drawableResourceId);
   previous = (Button) findViewById(R.id.previous);
   previous.setOnClickListener(this);
   database = new MySQLiteOpenHelper(extra_lesson.this);
   arr = database.getAllExtra();
   if (arr.size() != 0) {
     bundle = getIntent().getExtras();
     tvExtra_lesson.setText(arr.get(bundle.getInt("idStory")).getTen());
     tvExtra_content.setText(arr.get(bundle.getInt("idStory")).getNoidung());
   }
 }
Example #22
0
  private void findView() {
    iv_weixin = (ImageView) findViewById(R.id.iv_weixin);
    iv_qq = (ImageView) findViewById(R.id.iv_qq);
    iv_weibo = (ImageView) findViewById(R.id.iv_weibo);
    iv_kongjian = (ImageView) findViewById(R.id.iv_kongjian);
    iv_back = (ImageView) findViewById(R.id.iv_back);
    myOnClickListener = new MyOnClickListener();
    iv_weixin.setOnClickListener(myOnClickListener);
    iv_qq.setOnClickListener(myOnClickListener);
    iv_weibo.setOnClickListener(myOnClickListener);
    iv_kongjian.setOnClickListener(myOnClickListener);
    iv_back.setOnClickListener(
        new View.OnClickListener() {
          @Override
          public void onClick(View v) {
            finish();
          }
        });

    tv_regeister = (TextView) findViewById(R.id.tv_regeister);
    tv_phone_logo = (TextView) findViewById(R.id.tv_phone_logo);
    // 注册
    tv_regeister.setOnClickListener(
        new View.OnClickListener() {
          @Override
          public void onClick(View v) {
            Regeister();
          }
        });
  }
Example #23
0
 @Override
 public void onCreate(Bundle savedInstanceState) {
   super.onCreate(savedInstanceState);
   LayoutInflater inflater = getActivity().getLayoutInflater();
   mainView =
       inflater.inflate(
           R.layout.item_lesson_type5_2, (ViewGroup) getActivity().findViewById(R.id.vp), false);
   imgLine1 = (ImageView) mainView.findViewById(R.id.imgLine1);
   imgLine2 = (ImageView) mainView.findViewById(R.id.imgLine2);
   imgLine3 = (ImageView) mainView.findViewById(R.id.imgLine3);
   imgLine4 = (ImageView) mainView.findViewById(R.id.imgLine4);
   imgLock1 = (ImageView) mainView.findViewById(R.id.imgLock1);
   imgLock2 = (ImageView) mainView.findViewById(R.id.imgLock2);
   imgLock3 = (ImageView) mainView.findViewById(R.id.imgLock3);
   imgStart1 = (ImageView) mainView.findViewById(R.id.imgStart1);
   imgStart2 = (ImageView) mainView.findViewById(R.id.imgStart2);
   imgStart3 = (ImageView) mainView.findViewById(R.id.imgStart3);
   rbStar1 = (RatingBarView) mainView.findViewById(R.id.rbStar1);
   rbStar2 = (RatingBarView) mainView.findViewById(R.id.rbStar2);
   rbStar3 = (RatingBarView) mainView.findViewById(R.id.rbStar3);
   imgModule1 = (ImageView) mainView.findViewById(R.id.imgModule1);
   imgModule1.setOnClickListener(this);
   imgModule2 = (ImageView) mainView.findViewById(R.id.imgModule2);
   imgModule2.setOnClickListener(this);
   imgModule3 = (ImageView) mainView.findViewById(R.id.imgModule3);
   imgModule3.setOnClickListener(this);
 }
Example #24
0
 private void setListener() {
   circleLogo.setOnClickListener(this);
   btnExit.setOnClickListener(this);
   btnDissolve.setOnClickListener(this);
   back.setOnClickListener(this);
   edit.setOnClickListener(this);
 }
Example #25
0
  private void initiateView() {
    LayoutInflater.from(mContext).inflate((R.layout.search_view), this, true);

    mSearchLayout = findViewById(R.id.search_layout);
    mCardView = (CardView) mSearchLayout.findViewById(R.id.cardView);

    LinearLayoutManager layoutManager =
        new LinearLayoutManager(mContext, LinearLayoutManager.VERTICAL, false);
    mSuggestionsRecyclerView = (RecyclerView) mSearchLayout.findViewById(R.id.recyclerView);
    mSuggestionsRecyclerView.setLayoutManager(layoutManager);
    mSuggestionsRecyclerView.setItemAnimator(new DefaultItemAnimator());
    mSuggestionsRecyclerView.setVisibility(GONE);

    mSearchEditText = (EditText) mSearchLayout.findViewById(R.id.editText_input);
    mBackImageView = (ImageView) mSearchLayout.findViewById(R.id.imageView_arrow_back);
    mVoiceImageView = (ImageView) mSearchLayout.findViewById(R.id.imageView_mic);
    mEmptyImageView = (ImageView) mSearchLayout.findViewById(R.id.imageView_clear); // CLEAR
    mTintView = mSearchLayout.findViewById(R.id.view_transparent);
    mSeparatorView = mSearchLayout.findViewById(R.id.view_separator);

    mSearchEditText.setOnClickListener(mOnClickListener);
    mBackImageView.setOnClickListener(mOnClickListener);
    mVoiceImageView.setOnClickListener(mOnClickListener);
    mEmptyImageView.setOnClickListener(mOnClickListener);
    mTintView.setOnClickListener(mOnClickListener);
    mSeparatorView.setVisibility(GONE);

    showVoice(true);
    initSearchView();
  }
  private void init(AttributeSet attrs) {
    inflate(getContext(), R.layout.searchbar, this);

    TypedArray array = getContext().obtainStyledAttributes(attrs, R.styleable.MaterialSearchBar);
    iconRightResId = array.getResourceId(R.styleable.MaterialSearchBar_iconRight, -1);
    iconLefttResId = array.getResourceId(R.styleable.MaterialSearchBar_iconLeft, -1);
    hint = array.getString(R.styleable.MaterialSearchBar_hint);
    maxSuggestionCount = array.getInt(R.styleable.MaterialSearchBar_maxSuggestionsCount, 3);
    speechMode = array.getBoolean(R.styleable.MaterialSearchBar_speechMode, false);

    destiny = getResources().getDisplayMetrics().density;
    adapter = new SuggestionsAdapter(LayoutInflater.from(getContext()));
    adapter.setOnClickListener(this);
    adapter.maxSuggestionsCount = maxSuggestionCount;
    RecyclerView recyclerView = (RecyclerView) findViewById(R.id.mt_recycler);
    recyclerView.setAdapter(adapter);
    recyclerView.setLayoutManager(new LinearLayoutManager(getContext()));

    array.recycle();

    searchIcon = (ImageView) findViewById(R.id.mt_search);
    arrowIcon = (ImageView) findViewById(R.id.mt_arrow);
    searchEdit = (EditText) findViewById(R.id.mt_editText);
    inputContainer = (LinearLayout) findViewById(R.id.inputContainer);
    findViewById(R.id.mt_clear).setOnClickListener(this);

    arrowIcon.setOnClickListener(this);
    searchEdit.setOnFocusChangeListener(this);
    setOnClickListener(this);
    searchEdit.setOnEditorActionListener(this);
    if (speechMode) searchIcon.setOnClickListener(this);

    setupIcons();
  }
Example #27
0
  private void dependToShowDialog() {
    if (!SomeUtil.hasSystemFeatureGPS(this)) {
      // 系统没有 GPS 模块就不弹出开启 GPS 的对话框
      return;
    }
    if (!SomeUtil.isGPSOn(this)) {
      mDialog = new Dialog(this, R.style.Dialog_style_dim2);
      View view = View.inflate(this, R.layout.dialog_my_vehicle_condition, null);
      TextView txt1 = (TextView) view.findViewById(R.id.txt_dialog_my_vehicle_condition_heading);
      TextView txt2 = (TextView) view.findViewById(R.id.txt_dialog_my_vehicle_condition_subheading);
      ImageView ivYes = (ImageView) view.findViewById(R.id.iv_dialog_my_vehicle_condition_yes);
      ImageView ivNo = (ImageView) view.findViewById(R.id.iv_dialog_my_vehicle_condition_no);

      txt1.setText(getResources().getString(R.string.myVehicleCondition_heading_no_gps));
      txt2.setText(getResources().getString(R.string.myVehicleCondition_subheading_no_gps));
      ivYes.setOnClickListener(mDialogOnClickListener);
      ivNo.setOnClickListener(mDialogOnClickListener);

      mDialog.setContentView(view);
      mDialog.setCanceledOnTouchOutside(true);
      mDialog.getWindow().setType((WindowManager.LayoutParams.TYPE_SYSTEM_ALERT));
      mDialog.show();
    } else {
      mLocationClient.start();
    }
  }
Example #28
0
  public void initializeMainWork() {
    mContext = getApplicationContext();
    // StricMode Thread Policy setting
    StrictMode.setThreadPolicy(
        new StrictMode.ThreadPolicy.Builder()
            .permitDiskReads()
            .permitDiskWrites()
            .permitNetwork()
            .build());
    select_icon = (Button) findViewById(R.id.select_icon);
    select_icon.setOnClickListener(this);

    mAddress = new MyAddress();
    mAddress.getAddressFromText();
    if (!mAddress.getIP().equals("")
        && !mAddress.getPORTDATA().equals("")
        && !mAddress.getPORTVIDEO().equals("")) {
      SIP = mAddress.getIP();
      DATA_SPORT = mAddress.getPORTDATA();
      VIDEO_SPORT = mAddress.getPORTVIDEO();
      editText3.setText(SIP);
      editText4.setText(DATA_SPORT);
      editText5.setText(VIDEO_SPORT);
      CONNECTION_READY = true;
    }

    mUser = new MyUser();

    img_lock = (ImageView) findViewById(R.id.image_lock);
    img_unlock = (ImageView) findViewById(R.id.image_unlock);
    img_lock.setOnClickListener(this);
    img_unlock.setOnClickListener(this);
  }
  @Override
  public void onClick(View v) {
    ImageView clickedImage = (ImageView) v;
    if (firstTurn || (int) previousCard.getTag() != (int) clickedImage.getTag()) {
      firstTurn = false;
      counter++;
      int tag = (int) v.getTag();

      clickedImage.setImageResource(images[shuffle[tag]]);
      if (counter % 2 == 0) {
        if (checkCards(clickedImage, previousCard)) {
          // they are the same...
          clickedImage.setOnClickListener(null);
          previousCard.setOnClickListener(null);
          rightGuesses++;
          if (rightGuesses == images.length) {
            Intent intent = new Intent(this, EndGameActivity.class);
            intent.putExtra(SCORE, counter);
            startActivity(intent);
            finish();
          }
        } else {
          // not the same...
          FlipCardsThread thread = new FlipCardsThread(clickedImage, previousCard);
          thread.start();
        }
      }
    }
    previousCard = clickedImage;
  }
  protected void initComponents(View view) {
    btnCancel = (ImageView) view.findViewById(R.id.btn_cancel);
    btnApply = (ImageView) view.findViewById(R.id.btn_apply_changes);
    btnDelete = (ImageView) view.findViewById(R.id.btn_delete);

    btnCancel.setOnClickListener(
        new View.OnClickListener() {
          @Override
          public void onClick(View v) {
            dismiss();
          }
        });
    btnApply.setOnClickListener(
        new View.OnClickListener() {
          @Override
          public void onClick(View v) {
            notifyApply();
          }
        });
    btnDelete.setOnClickListener(
        new View.OnClickListener() {
          @Override
          public void onClick(View v) {
            notifyDelete();
          }
        });

    if (!getShowsDialog()) {
      View buttonsContainer = view.findViewById(R.id.container_buttons_edit_dialog);
      buttonsContainer.setVisibility(View.GONE);
    }
  }