Java Code Examples for android.widget.TextView

The following examples show how to use android.widget.TextView. These examples are extracted from open source projects. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may want to check out the right sidebar which shows the related API usage.
Example 1
Source Project: FimiX8-RE   Source File: X8AiFollowConfirmUi.java    License: MIT License 6 votes vote down vote up
public void initViews(View rootView) {
    this.imgReturn = rootView.findViewById(R.id.img_ai_follow_return);
    this.btnOk = rootView.findViewById(R.id.btn_ai_follow_confirm_ok);
    this.cbTip = (CheckBox) rootView.findViewById(R.id.cb_ai_follow_confirm_ok);
    this.vItemSelect = rootView.findViewById(R.id.ll_ai_follow_item);
    this.vConfirm = rootView.findViewById(R.id.rl_ai_follow_info_confirm);
    this.tvTitle = (TextView) rootView.findViewById(R.id.tv_ai_follow_title);
    this.tvContentTip1 = (TextView) rootView.findViewById(R.id.tv_ai_follow_confirm_title1);
    this.tvContentTip2 = (TextView) rootView.findViewById(R.id.tv_ai_follow_confirm_title2);
    this.svTips = (ScrollView) rootView.findViewById(R.id.sv_ai_items);
    this.vItem1 = rootView.findViewById(R.id.rl_ai_follow_normal);
    this.vItem2 = rootView.findViewById(R.id.rl_ai_follow_parallel);
    this.vItem3 = rootView.findViewById(R.id.rl_ai_follow_lockup);
    this.vItemSelect.setVisibility(0);
    this.vConfirm.setVisibility(8);
    this.tvTitle.setText(this.contentView.getContext().getString(R.string.x8_ai_fly_follow));
    this.imgFlag = (ImageView) rootView.findViewById(R.id.img_follow_flag);
}
 
Example 2
Source Project: opentasks   Source File: ChoicesFieldEditor.java    License: Apache License 2.0 6 votes vote down vote up
@Override
public View getDropDownView(int position, View convertView, ViewGroup parent)
{
    if (convertView == null)
    {
        // inflate a new view and add a tag
        convertView = mLayoutInflater.inflate(R.layout.integer_choices_spinner_item, parent, false);
        SpinnerItemTag tag = new SpinnerItemTag();
        tag.image = (ImageView) convertView.findViewById(R.id.integer_choice_item_image);
        tag.text = (TextView) convertView.findViewById(R.id.integer_choice_item_text);
        convertView.setTag(tag);
    }

    populateView(position, convertView);

    return convertView;
}
 
Example 3
Source Project: AndroidProjects   Source File: LongListActivity.java    License: MIT License 6 votes vote down vote up
@Override
public View getView(final int position, View convertView, ViewGroup parent) {
    // Inflate list items.
    if (null == convertView) {
        convertView = layoutInflater.inflate(R.layout.list_item, null);
    }

    convertView.setOnClickListener(new View.OnClickListener() {
        @Override
        public void onClick(View v) {
            ((TextView) findViewById(R.id.selection_row_value)).setText(
                    String.valueOf(position));
        }
    });

    return super.getView(position, convertView, parent);
}
 
Example 4
Source Project: Popeens-DSub   Source File: ArtistAdapter.java    License: GNU General Public License v3.0 6 votes vote down vote up
@Override
public void onBindHeaderHolder(UpdateView.UpdateViewHolder holder, String header, int sectionIndex) {
	TextView folderName = (TextView) holder.getView().findViewById(R.id.select_artist_folder_2);

	String musicFolderId = Util.getSelectedMusicFolderId(context);
	if(musicFolderId != null) {
		for (MusicFolder musicFolder : musicFolders) {
			if (musicFolder.getId().equals(musicFolderId)) {
				folderName.setText(musicFolder.getName());
				break;
			}
		}
	} else {
		folderName.setText(R.string.select_artist_all_folders);
	}
}
 
Example 5
Source Project: Mp4Composer-android   Source File: VideoListAdapter.java    License: MIT License 6 votes vote down vote up
@NonNull
@Override
public View getView(int position, View convertView, ViewGroup parent) {
    VideoItem data = getItem(position);

    if (null == convertView) {
        convertView = layoutInflater.inflate(R.layout.row_video_list, null);
    }

    ImageView imageView = convertView.findViewById(R.id.image);
    TextView textView = convertView.findViewById(R.id.txt_image_name);

    Glide.with(getContext().getApplicationContext())
            .load(data.getPath())
            .into(imageView);

    textView.setText(data.getPath());

    return convertView;
}
 
Example 6
Source Project: QRefreshLayout   Source File: DefaultLoadView.java    License: MIT License 6 votes vote down vote up
public DefaultLoadView(Context context, @Nullable AttributeSet attrs) {
    super(context, attrs);
    setLayoutParams(new RelativeLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT));

    tvContent = new TextView(context);
    tvContent.setId(View.generateViewId());
    addView(tvContent);
    RelativeLayout.LayoutParams contentParams = (LayoutParams) tvContent.getLayoutParams();
    contentParams.addRule(RelativeLayout.CENTER_IN_PARENT);

    progressBar = new ProgressBar(context);
    addView(progressBar);
    final float density = getContext().getResources().getDisplayMetrics().density;
    RelativeLayout.LayoutParams params = (LayoutParams) progressBar.getLayoutParams();
    params.width = (int) (20 * density);
    params.height = (int) (20 * density);
    params.addRule(RelativeLayout.CENTER_IN_PARENT);
    params.rightMargin = (int) (10 * density);
    params.addRule(RelativeLayout.LEFT_OF, tvContent.getId());
    progressBar.setLayoutParams(params);
}
 
Example 7
Source Project: FragmentMaster   Source File: ReceiveResult.java    License: Apache License 2.0 6 votes vote down vote up
@Override
public void onViewCreated(View view, Bundle savedInstanceState) {
    super.onViewCreated(view, savedInstanceState);
    mResultView = (TextView) view.findViewById(R.id.resultView);
    view.findViewById(R.id.button).setOnClickListener(
            new OnClickListener() {
                @Override
                public void onClick(View v) {
                    startFragmentForResult(NumbersList.class, REQUEST_CODE);
                }
            });
    FragmentManager fragmentManager = getChildFragmentManager();
    if (fragmentManager.findFragmentByTag("TAG_CHILD") == null) {
        FragmentTransaction ft = fragmentManager.beginTransaction();
        ft.add(R.id.childContainer, new Child(), "TAG_CHILD");
        ft.commitAllowingStateLoss();
        fragmentManager.executePendingTransactions();
    }
}
 
Example 8
Source Project: BlackList   Source File: ProgressDialogHolder.java    License: Apache License 2.0 6 votes vote down vote up
public void show(Context context, @StringRes int titleId, @StringRes int messageId,
                 DialogInterface.OnCancelListener listener) {
    dismiss();
    DialogBuilder builder = new DialogBuilder(context);
    if (titleId > 0) {
        builder.setTitle(titleId);
    }
    LayoutInflater inflater = LayoutInflater.from(context);
    View itemView = inflater.inflate(R.layout.row_progress, null);
    messageTextView = (TextView) itemView.findViewById(R.id.text_progress);
    if (messageId > 0) {
        messageTextView.setText(messageId);
    }
    builder.addItem(itemView);
    builder.setOnCancelListener(listener);
    dialog = builder.show();
}
 
Example 9
Source Project: Kernel-Tuner   Source File: TMAdapter.java    License: GNU General Public License v3.0 6 votes vote down vote up
private ViewHolder getViewHolder(final View workingView)
{
    final Object tag = workingView.getTag();
    ViewHolder viewHolder = null;


    if (null == tag || !(tag instanceof ViewHolder))
    {
        viewHolder = new ViewHolder();

        viewHolder.nameView = (TextView) workingView.findViewById(R.id.name);
        viewHolder.mbView = (TextView) workingView.findViewById(R.id.mb);
        viewHolder.imageView = (ImageView) workingView.findViewById(R.id.icon);
        viewHolder.killView = (Button) workingView.findViewById(R.id.kill);
        viewHolder.pidView = (TextView) workingView.findViewById(R.id.pid);

        workingView.setTag(viewHolder);

    }
    else
    {
        viewHolder = (ViewHolder) tag;
    }

    return viewHolder;
}
 
Example 10
Source Project: react-native-android-wear-demo   Source File: MainActivity.java    License: MIT License 6 votes vote down vote up
@Override
protected void onCreate(Bundle savedInstanceState) {
  super.onCreate(savedInstanceState);
  setContentView(R.layout.activity_main);
  btnIncreaseCounter = (Button) findViewById(R.id.btnWearIncreaseCounter);
  btnIncreaseCounter.getBackground().setColorFilter(0xFF1194F7, PorterDuff.Mode.MULTIPLY);
  tvCounter = (TextView) findViewById(R.id.tvCounter);
  tvCounter.setText(Integer.toString(count));

  client = new GoogleApiClient.Builder(this).addApi(Wearable.API)
    .addConnectionCallbacks(this)
    .addOnConnectionFailedListener(this)
    .build();

  btnIncreaseCounter.setOnClickListener(clickListener);
}
 
Example 11
Source Project: WifiChat   Source File: SettingInfoActivity.java    License: GNU General Public License v2.0 6 votes vote down vote up
@Override
protected void initViews() {

    mIvAvater = (ImageView) findViewById(R.id.setting_my_avater_img);
    mEtNickname = (EditText) findViewById(R.id.setting_my_nickname);
    mRgGender = (RadioGroup) findViewById(R.id.setting_baseinfo_rg_gender);
    mHtvConstellation = (TextView) findViewById(R.id.setting_birthday_htv_constellation);
    mHtvAge = (TextView) findViewById(R.id.setting_birthday_htv_age);
    mDpBirthday = (DatePicker) findViewById(R.id.setting_birthday_dp_birthday);

    mRbBoy = (RadioButton) findViewById(R.id.setting_baseinfo_rb_male);
    mRbGirl = (RadioButton) findViewById(R.id.setting_baseinfo_rb_female);

    mBtnBack = (Button) findViewById(R.id.setting_btn_back);
    mBtnNext = (Button) findViewById(R.id.setting_btn_next);

}
 
Example 12
Source Project: AndrOBD   Source File: BtDeviceListActivity.java    License: GNU General Public License v3.0 6 votes vote down vote up
public void onItemClick(AdapterView<?> av, View v, int arg2, long arg3)
{
	// Cancel discovery because it's costly and we're about to connect
	mBtAdapter.cancelDiscovery();

	// Get the device MAC address, which is the last 17 chars in the View
	String info = ((TextView) v).getText().toString();
	String address = info.substring(info.length() - 17);
	//String address = "00:0D:18:A0:4E:35"; //FORCE OBD MAC Address
	// Create the result Intent and include the MAC address
	Intent intent = new Intent();
	intent.putExtra(EXTRA_DEVICE_ADDRESS, address);

	// Set result and finish this Activity
	setResult(Activity.RESULT_OK, intent);
	log.log(Level.FINE, "Sending Result...");
	finish();
}
 
Example 13
Source Project: xDrip-plus   Source File: ThinJamActivity.java    License: GNU General Public License v3.0 6 votes vote down vote up
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    binding = ActivityThinJamBinding.inflate(getLayoutInflater());
    binding.setVm(new ViewModel(this));
    setContentView(binding.getRoot());
    JoH.fixActionBar(this);

    scanMeister.setFilter(customFilter);
    scanMeister.allowWide().unlimitedMatches();
    scanMeister.addCallBack2(this, TAG);

    ((TextView) findViewById(R.id.tjLogText)).setMovementMethod(new ScrollingMovementMethod());

    // handle incoming extras - TODO do we need to wait for service connect?
    final Bundle bundle = getIntent().getExtras();
    processIncomingBundle(bundle);

    LocationHelper.requestLocationForBluetooth(this);
}
 
Example 14
Source Project: AirFree-Client   Source File: TalkActivity.java    License: GNU General Public License v3.0 6 votes vote down vote up
private void init() {
        iLanguage();
        sendMessage("talk", getIPAddress() + strJoinToChatroom);
        app = (ApplicationUtil) this.getApplication();
        tvShow = (TextView) findViewById(R.id.tv_show);
        tvShow.setText(strShow);
        btnBack = (Button) findViewById(R.id.btn_back);
        btnBack.setOnClickListener(this);
        btnSend = (Button) findViewById(R.id.btn_send);
        btnSend.setText(strSend);
        btnSend.setOnClickListener(this);
        etContent = (EditText) findViewById(R.id.et_content);
        lvTalk = (ListView) findViewById(R.id.lv_talk);
        lvTalk.setDividerHeight(0);
        adapter = new TalkAdapter(this, list);
        lvTalk.setAdapter(adapter);
        lvTalk.smoothScrollToPosition(adapter.getCount() - 1);
//        tHandler.post(tRunnable);
        mThreadClient = new Thread(tRunnable);
        mThreadClient.start();
    }
 
Example 15
Source Project: BotLibre   Source File: ForumActivity.java    License: Eclipse Public License 1.0 6 votes vote down vote up
public void resetView() {
       setContentView(R.layout.activity_forum);
	
       ForumConfig instance = (ForumConfig)MainActivity.instance;

       super.resetView();

       if (instance.isExternal) {
       	findViewById(R.id.newPostButton).setVisibility(View.GONE);
       	findViewById(R.id.postsButton).setVisibility(View.GONE);
       }

   	TextView text = (TextView) findViewById(R.id.postsLabel);
       if (instance.posts != null && instance.posts.length() > 0) {
        text.setText(instance.posts + " posts");
       } else {
        text.setText("");        	
       }
}
 
Example 16
public View getView(int position, View convertView, ViewGroup parent) {
    View view;

    if (convertView == null) {
        view = mInflater.inflate(R.layout.wallpaper_picker_third_party_item, parent, false);
    } else {
        view = convertView;
    }

    ResolveInfo info = mThirdPartyWallpaperPickers.get(position).mResolveInfo;
    TextView label = (TextView) view.findViewById(R.id.wallpaper_item_label);
    label.setText(info.loadLabel(mPackageManager));
    Drawable icon = info.loadIcon(mPackageManager);
    icon.setBounds(new Rect(0, 0, mIconSize, mIconSize));
    label.setCompoundDrawables(null, icon, null, null);
    return view;
}
 
Example 17
Source Project: permiso   Source File: PermisoDialogFragment.java    License: MIT License 5 votes vote down vote up
@NonNull
@Override
public Dialog onCreateDialog(Bundle savedInstanceState) {
    AlertDialog.Builder builder = new AlertDialog.Builder(getActivity(), mThemeId);

    // Title
    if (mTitle != null) {
        builder.setTitle(mTitle);
    }

    // Message
    if (mHasHtml) {
        TextView msg = new TextView(getActivity());
        msg.setText(Html.fromHtml(mMessage));
        msg.setMovementMethod(LinkMovementMethod.getInstance());
        builder.setView(msg);
    } else if (mMessage != null) {
        builder.setMessage(mMessage);
    }

    // Button text
    String buttonText;
    if (mButtonText != null) {
        buttonText = mButtonText;
    } else {
        buttonText = getString(android.R.string.ok);
    }
    builder.setPositiveButton(buttonText, new DialogInterface.OnClickListener() {
        @Override
        public void onClick(DialogInterface dialog, int which) {
            if (mOnCloseListener != null) {
                mOnCloseListener.onClose();
            }
        }
    });
    return builder.create();
}
 
Example 18
Source Project: styT   Source File: SampleAdapter.java    License: Apache License 2.0 5 votes vote down vote up
public HeaderViewHolder(View itemView) {
    super(itemView);
    linearLayout = (LinearLayout) itemView.findViewById(R.id.lxw_id_item_helps_include_avertor);
    userimg = (nico.styTool.CircleImageView) linearLayout.findViewById(R.id.lxw_id_item_helps_userimg);
    username = (TextView) linearLayout.findViewById(R.id.lxw_id_item_helps_username);
    personality = (TextView) linearLayout.findViewById(R.id.lxw_id_item_helps_user_personality);
    creatTime = (TextView) linearLayout.findViewById(R.id.lxw_id_item_helps_create_time);
    content = (TextView) itemView.findViewById(R.id.lxw_id_item_helps_content);
    frameLayout = (FrameLayout) itemView.findViewById(R.id.lxw_id_item_helps_include_img);
    gridView = (GridView) frameLayout.findViewById(R.id.lxw_id_item_helps_gridview);
    contentImg = (ImageView) frameLayout.findViewById(R.id.lxw_id_item_helps_content_img);
}
 
Example 19
Source Project: Sparkplug   Source File: MessageListItemAdapter.java    License: Eclipse Public License 1.0 5 votes vote down vote up
@NonNull
@Override
public View getView(final int position, View convertView, @NonNull ViewGroup parent){
    LayoutInflater inflater = (LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
    View rowView = inflater.inflate(R.layout.message_list_item, parent, false);

    // Set up the topic tokens
    TextView topicTextView = (TextView) rowView.findViewById(R.id.message_topic_text);
    String[] topicTokens = messages.get(position).getTopic().split("/");
    if (messages.get(position).getMessageType() == MessageType.Published) {
        topicTextView.setText(topicTokens[1] + " :: " + topicTokens[3] + " :: Published");
    } else if (messages.get(position).getMessageType() == MessageType.Received) {
        topicTextView.setText(topicTokens[1] + " :: " + topicTokens[3] + " :: Received");
    }


    // Set up the payload
    try {
        PayloadDecoder<SparkplugBPayload> decoder = new SparkplugBPayloadDecoder();
        SparkplugBPayload incomingPayload = decoder.buildFromByteArray(messages.get(position).getMessage().getPayload());

        TextView payloadTextView = (TextView) rowView.findViewById(R.id.message_payload_text);

        StringBuilder sb = new StringBuilder();
        for (Metric metric : incomingPayload.getMetrics()) {
            sb.append(metric.getName()).append("=").append(metric.getValue()).append("   ");
        }

        payloadTextView.setText(sb.toString());
    } catch (Exception e) {
        Log.d(TAG, "Failed to parse out payload", e);
    }

    TextView dateTextView = (TextView) rowView.findViewById(R.id.message_date_text);
    DateFormat dateTimeFormatter = SimpleDateFormat.getDateTimeInstance(DateFormat.SHORT, DateFormat.MEDIUM);
    String shortDateStamp = dateTimeFormatter.format(messages.get(position).getTimestamp());
    dateTextView.setText(context.getString(R.string.message_time_fmt, shortDateStamp));

    return rowView;
}
 
Example 20
Source Project: fitness_Android   Source File: MeFragment.java    License: Apache License 2.0 5 votes vote down vote up
public void findViewById(View v) {
    homepage = (LinearLayout) v.findViewById(R.id.me_homepage);
    comment = (LinearLayout) v.findViewById(R.id.me_item_comment);
    record = (LinearLayout) v.findViewById(R.id.me_item_reord);
    favor = (LinearLayout) v.findViewById(R.id.me_item_favor);

    usernameTV = (TextView) v.findViewById(R.id.me_homepage_username);
    exerciseTimeTextView = (TextView) v.findViewById(R.id.me_exercise_time);
    recordDaysTextView = (TextView) v.findViewById(R.id.me_record_days);
    exit = (TextView) v.findViewById(R.id.me_item_exit);
}
 
Example 21
@Override
public View getGroupView(int listPosition, boolean isExpanded,
View convertView, ViewGroup parent) {
    String listTitle = (String) getGroup(listPosition);
    if (convertView == null) {
        LayoutInflater layoutInflater = (LayoutInflater) this.context.
                getSystemService(Context.LAYOUT_INFLATER_SERVICE);
        convertView = layoutInflater.inflate(R.layout.list_group, null);
    }
    TextView listTitleTextView = (TextView) convertView
            .findViewById(R.id.listTitle);
    listTitleTextView.setTypeface(null, Typeface.BOLD);
    listTitleTextView.setText(listTitle);
    return convertView;
}
 
Example 22
@Override protected void onFinishInflate() {
  super.onFinishInflate();
  modifierTitle = (TextView) findViewById(R.id.bike_image_modifier_title);
  textSwitcher = (TextSwitcher) findViewById(R.id.text_switcher);
  textSwitcher.setFactory(new ViewSwitcher.ViewFactory() {
    @Override public View makeView() {
      return LayoutInflater.from(getContext()).inflate(R.layout.modifier_value_textview, null);
    }
  });
}
 
Example 23
Source Project: iBeebo   Source File: ManageGroupActivity.java    License: GNU General Public License v3.0 5 votes vote down vote up
@Override
public View getView(int position, View convertView, ViewGroup parent) {

    View view = getActivity().getLayoutInflater().inflate(R.layout.managegroupactivity_list_item_layout, parent,
            false);
    TextView tv = (TextView) view;
    tv.setBackgroundColor(defaultBG);
    if (getListView().getCheckedItemPositions().get(position)) {
        tv.setBackgroundColor(checkedBG);
    }
    tv.setText(name.get(position));
    return view;
}
 
Example 24
@Override
protected void onCreate(Bundle savedInstanceState)
{
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_left_drawer_layout);

    mLeftDrawerLayout = (LeftDrawerLayout) findViewById(R.id.id_drawerlayout);
    mContentTv = (TextView) findViewById(R.id.id_content_tv);

    FragmentManager fm = getSupportFragmentManager();
    mMenuFragment = (LeftMenuFragment) fm.findFragmentById(R.id.id_container_menu);
    if (mMenuFragment == null)
    {
        fm.beginTransaction().add(R.id.id_container_menu, mMenuFragment = new LeftMenuFragment()).commit();
    }

    mMenuFragment.setOnMenuItemSelectedListener(new LeftMenuFragment.OnMenuItemSelectedListener()
    {
        @Override
        public void menuItemSelected(String title)
        {
            mLeftDrawerLayout.closeDrawer();
            mContentTv.setText(title);
        }
    });

}
 
Example 25
/**
 * Loads view from resources
 * @param resource the resource Id
 * @return the loaded view or null if resource is not set
 */
private View getView(int resource, ViewGroup parent) {
    switch (resource) {
    case NO_RESOURCE:
        return null;
    case TEXT_VIEW_ITEM_RESOURCE:
        return new TextView(context);
    default:
        return inflater.inflate(resource, parent, false);    
    }
}
 
Example 26
Source Project: goproxy-android   Source File: MainActivity.java    License: GNU General Public License v3.0 5 votes vote down vote up
public View.OnClickListener stop(final TextView status, final EditText editText) {
    return new View.OnClickListener() {
        @Override
        public void onClick(View view) {
            Proxysdk.stop((serviceID));
            editText.setEnabled(true);
            status.setText(R.string.stopped);
        }
    };
}
 
Example 27
Source Project: edx-app-android   Source File: FormFieldSelectFragment.java    License: Apache License 2.0 5 votes vote down vote up
private static void addDetectedValueHeader(@NonNull ListView listView, @StringRes int labelRes, @NonNull String labelKey, @NonNull String labelValue, @NonNull String value, @NonNull Icon icon) {
    final TextView textView = (TextView) LayoutInflater.from(listView.getContext()).inflate(R.layout.edx_selectable_list_item, listView, false);
    {
        final SpannableString labelValueSpan = new SpannableString(labelValue);
        labelValueSpan.setSpan(new ForegroundColorSpan(listView.getResources().getColor(R.color.edx_brand_gray_base)), 0, labelValueSpan.length(), Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);
        textView.setText(ResourceUtil.getFormattedString(listView.getContext().getResources(), labelRes, labelKey, labelValueSpan));
    }
    Context context = textView.getContext();
    TextViewCompat.setCompoundDrawablesRelativeWithIntrinsicBounds(textView,
            new IconDrawable(context, icon)
                    .sizeRes(context, R.dimen.edx_base)
                    .colorRes(context, R.color.edx_brand_gray_back)
            , null, null, null);
    listView.addHeaderView(textView, new FormOption(labelValue, value), true);
}
 
Example 28
Source Project: identity-samples   Source File: PhoneNumberActivity.java    License: Apache License 2.0 5 votes vote down vote up
PhoneNumberUi(View root, String activityTitle) {
    title = (TextView) root.findViewById(R.id.phone_number_title);
    phoneField = (EditText) root.findViewById(R.id.phone_number_field);
    submit = (Button) root.findViewById(R.id.phone_number_submit);
    phoneFocus = new FocusControl(phoneField);

    title.setText(activityTitle);
    submit.setOnClickListener(this);
    phoneField.setOnClickListener(this);
    setSubmitEnabled(true);
}
 
Example 29
Source Project: friendspell   Source File: CustomMatchers.java    License: Apache License 2.0 5 votes vote down vote up
public static Matcher<View> withoutCompoundDrawable(final int position) {
  return new BoundedMatcher<View, TextView>(TextView.class) {
    @Override public void describeTo(Description description) {
      description.appendText(
          "does not have compound drawable at position " + position);
    }
    @Override public boolean matchesSafely(TextView textView) {
      Drawable drawables[] = textView.getCompoundDrawables();
      return (drawables[position] == null);
    }
  };
}
 
Example 30
Source Project: bleTester   Source File: BleDeviceListAdapter.java    License: Apache License 2.0 5 votes vote down vote up
@SuppressLint("InflateParams")
@Override
public View getView(int position, View view, ViewGroup arg2) {
	// TODO Auto-generated method stub

	ViewHolder viewholder;
	if (view == null) {
		view = mInflater.inflate(R.layout.item_devicelist, null);
		viewholder = new ViewHolder();
		viewholder.devicename = (TextView) view
				.findViewById(R.id.tv_devicelist_name);
		viewholder.deviceAddress = (TextView) view
				.findViewById(R.id.tv_devicelist_address);
		viewholder.deviceRSSI = (TextView) view
				.findViewById(R.id.tv_devicelist_rssi);
		viewholder.devicerecord = (TextView) view
				.findViewById(R.id.tv_devicelist_scanRecord);
		viewholder.devicerecord_name = (TextView) view
				.findViewById(R.id.tv_devicelist_scanRecord_name);
		view.setTag(viewholder);
	} else {
		viewholder = (ViewHolder) view.getTag();
	}
	String name = mLeDevices.get(position).getName();
	if (name != null)
		viewholder.devicename.setText(name);
	else
		viewholder.devicename.setText("Unknow Device");
	viewholder.deviceAddress.setText("��ַ�� "
			+ mLeDevices.get(position).getAddress());
	viewholder.deviceRSSI.setText("�źţ� " + RSSIs.get(position).toString());
	viewholder.devicerecord.setText("�㲥���� " + "\n"
			+ scanRecords.get(position));
	viewholder.devicerecord_name.setText("�㲥���е�����:"
			+ Utils.ParseScanRecord(scanRecords.get(position)));
	return view;
}
 
Example 31
@Override
public void onShowItemPickerDialog(FloatingLabelItemPickerWithSetSelectedItems floatingLabelItemPicker) {
    if (!isExpanded) {
        floatingLabelItemPicker.floatLabel();
        ExpandAnimation.expand(viewToExpand);
        isExpanded = true;
    } else {
        if (((TextView) floatingLabelItemPicker.getInputWidget()).getText().toString().equals("")) {
           floatingLabelItemPicker.anchorLabel();
        }
        ExpandAnimation.collapse(viewToExpand);
        isExpanded = false;
    }
}
 
Example 32
Source Project: ScrollLayout   Source File: SecondActivity.java    License: Apache License 2.0 5 votes vote down vote up
private void initView() {
    ViewPager viewPager = (ViewPager) findViewById(R.id.view_pager);
    mGirlDesText = (TextView) findViewById(R.id.text_view);
    mScrollLayout = (ScrollLayout) findViewById(R.id.scroll_down_layout);
    toolbar = (Toolbar) findViewById(R.id.toolbar);
    toolbar.getBackground().setAlpha(0);
    toolbar.setNavigationIcon(R.mipmap.action_bar_return);
    toolbar.setTitle("ScrollLayout");
    setSupportActionBar(toolbar);
    getSupportActionBar().setHomeButtonEnabled(true);

    mScrollLayout.setOnScrollChangedListener(mOnScrollChangedListener);
    mScrollLayout.getBackground().setAlpha(0);

    MainPagerAdapter mainPagerAdapter = new MainPagerAdapter(this);
    mainPagerAdapter.setOnClickItemListener(mOnClickItemListener);
    viewPager.setAdapter(mainPagerAdapter);
    viewPager.setOnPageChangeListener(mOnPageChangeListener);
    mainPagerAdapter.initViewUrl(mAllAddressList);
    mGirlDesText.setText(mAllAddressList.get(0).getDesContent());
    toolbar.setNavigationOnClickListener(new View.OnClickListener() {
        @Override
        public void onClick(View v) {
            onBackPressed();
        }
    });
}
 
Example 33
@Override
public AbsMessageViewHolder onCreateViewHolder(MessagesAdapter adapter, ViewGroup root, Peer peer) {
    TextView itemView = new TextView(root.getContext());
    itemView.setId(R.id.text);
    BubbleContainer container = new BubbleContainer(root.getContext());
    container.addView(itemView, ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT);
    return new TextHolderEx(adapter, container);
}
 
Example 34
Source Project: imsdk-android   Source File: AddBuddyItemView.java    License: MIT License 5 votes vote down vote up
public AddBuddyItemView(Context context, AttributeSet attrs, int defStyleAttr) {
    super(context, attrs, defStyleAttr);
    ctx = context;
    final LayoutInflater inflater = (LayoutInflater) context.getSystemService(
            Context.LAYOUT_INFLATER_SERVICE);
    inflater.inflate(R.layout.atom_ui_item_add_buddy_view,this,true);
    ll_personal_info = (LinearLayout) findViewById(R.id.ll_personal_info);
    view_gravatar_buddy = (com.facebook.drawee.view.SimpleDraweeView) findViewById(R.id.view_gravatar_buddy);
    m_name = (TextView) findViewById(R.id.m_name);
    btn_add = (Button) findViewById(R.id.btn_add);
}
 
Example 35
Source Project: AndroidAll   Source File: BaseFragment.java    License: Apache License 2.0 5 votes vote down vote up
protected void printLog(TextView textView, String prefix, String s) {
    String content = prefix + "'" + s + "'" + "\nMain Thread:" + (getActivity().getMainLooper() == Looper.myLooper()) +
            ", Thread Name:" + Thread.currentThread().getName();
    Log.d("OnSubscribe", content);
    //if (!TextUtils.isEmpty(s)) {
    appendText(textView, content);
    //}
}
 
Example 36
Source Project: Android-skin-support   Source File: SkinMaterialTextInputLayout.java    License: MIT License 5 votes vote down vote up
private void applyCounterTextColorResource() {
    mCounterTextColorResId = SkinCompatHelper.checkResourceId(mCounterTextColorResId);
    if (mCounterTextColorResId != INVALID_ID) {
        TextView counterView = getCounterView();
        if (counterView != null) {
            counterView.setTextColor(SkinCompatResources.getColor(getContext(), mCounterTextColorResId));
            updateEditTextBackgroundInternal();
        }
    }
}
 
Example 37
Source Project: freeiot-android   Source File: DeviceControlActivity.java    License: MIT License 5 votes vote down vote up
@Override
	protected void onCreate(Bundle savedInstances) {
		super.onCreate(savedInstances);
		setContentView(R.layout.activity_outlet_control);
		
		Bundle bundle = getIntent().getExtras();
		if (bundle != null) {
            mIdentifier = bundle.getString("identifier");
//			operateUrl = String.format(operateUrl, mIdentifier);
			mUrl = bundle.getString("app");
			if (BridgeUtil.hasAssetFile(this, "index.html")) {
				mUrl = "file:///android_asset/index.html";
			}
			LogUtils.e("url=> " + mUrl);
//			mUrl = "file:///android_asset/index.html";
//            mUrl = "file:///android_asset/failed/404.html";
            mTitleName = bundle.getString("name");
			((TextView)findViewById(R.id.title)).setText(mTitleName);
		}
		
		mSwipeRefreshLayout = (SwipeRefreshLayout)findViewById(R.id.swipe_container);
		mSwipeRefreshLayout.setColorScheme(R.color.main_red_color);
		mSwipeRefreshLayout.setOnRefreshListener(this);
		
		mProgressBar = (ProgressBar)findViewById(R.id.progressbar);
		mWebView = (XWalkView) findViewById(R.id.webview);
		findViewById(R.id.back).setOnClickListener(this);
		bridgeHelper = new BridgeHelper(this, mWebView);
		initVebView();
	}
 
Example 38
Source Project: DanDanPlayForAndroid   Source File: LabelsView.java    License: MIT License 5 votes vote down vote up
private void innerClearAllSelect() {
    int count = getChildCount();
    for (int i = 0; i < count; i++) {
        setLabelSelect((TextView) getChildAt(i), false);
    }
    mSelectLabels.clear();
}
 
Example 39
Source Project: green_android   Source File: UI.java    License: GNU General Public License v3.0 5 votes vote down vote up
public static void mapEnterToPositive(final Dialog dialog, final int editId) {
    final TextView edit = UI.find(dialog, editId);
    edit.setOnEditorActionListener(getListenerRunOnEnter(() -> {
        final MaterialDialog md = (MaterialDialog) dialog;
        md.onClick(md.getActionButton(DialogAction.POSITIVE));
    }));
}
 
Example 40
Source Project: qiniu-lab-android   Source File: CaptureVideoActivity.java    License: MIT License 5 votes vote down vote up
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.capture_video_activity);
    this.context = this;
    this.initLayout();

    this.uploadProgressBar = (ProgressBar) this
            .findViewById(R.id.capture_video_upload_progressbar);
    this.uploadProgressBar.setMax(100);
    this.uploadStatusLayout = (LinearLayout) this
            .findViewById(R.id.capture_video_upload_status_layout);
    this.uploadSpeedTextView = (TextView) this
            .findViewById(R.id.capture_video_upload_speed_textview);
    this.uploadFileLengthTextView = (TextView) this
            .findViewById(R.id.capture_video_upload_file_length_textview);
    this.uploadPercentageTextView = (TextView) this
            .findViewById(R.id.capture_video_upload_percentage_textview);
    this.uploadStatusLayout.setVisibility(LinearLayout.INVISIBLE);
    this.uploadResultVideoView = (PLVideoView) this.findViewById(R.id.capture_video_play_pldplayer);
    this.uploadFileButton = (Button) this.findViewById(R.id.capture_video_upload_button);
    this.uploadFileButton.setEnabled(false);
    this.captureVideoFilePathTextView = (TextView) this.findViewById(R.id.capture_video_file_path_textview);

    this.persistentIdTextView = (TextView) this.findViewById(R.id.capture_video_pid_textview);
    this.pfopResult1TextView = (TextView) this.findViewById(R.id.capture_video1_textview);
    this.pfopResult2TextView = (TextView) this.findViewById(R.id.capture_video2_textview);
    this.loadPfopVideo1Button = (Button) this.findViewById(R.id.capture_load_video_button_1);
    this.loadPfopVideo2Button = (Button) this.findViewById(R.id.capture_load_video_button_2);
}