Search in sources :

Example 1 with TextView

use of android.widget.TextView in project MaterializeYourApp by antoniolg.

the class DetailActivity method onCreate.

@SuppressWarnings("ConstantConditions")
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    initActivityTransitions();
    setContentView(R.layout.activity_detail);
    ViewCompat.setTransitionName(findViewById(R.id.app_bar_layout), EXTRA_IMAGE);
    supportPostponeEnterTransition();
    setSupportActionBar((Toolbar) findViewById(R.id.toolbar));
    getSupportActionBar().setDisplayHomeAsUpEnabled(true);
    String itemTitle = getIntent().getStringExtra(EXTRA_TITLE);
    collapsingToolbarLayout = (CollapsingToolbarLayout) findViewById(R.id.collapsing_toolbar);
    collapsingToolbarLayout.setTitle(itemTitle);
    collapsingToolbarLayout.setExpandedTitleColor(getResources().getColor(android.R.color.transparent));
    final ImageView image = (ImageView) findViewById(R.id.image);
    Picasso.with(this).load(getIntent().getStringExtra(EXTRA_IMAGE)).into(image, new Callback() {

        @Override
        public void onSuccess() {
            Bitmap bitmap = ((BitmapDrawable) image.getDrawable()).getBitmap();
            Palette.from(bitmap).generate(new Palette.PaletteAsyncListener() {

                public void onGenerated(Palette palette) {
                    applyPalette(palette);
                }
            });
        }

        @Override
        public void onError() {
        }
    });
    TextView title = (TextView) findViewById(R.id.title);
    title.setText(itemTitle);
}
Also used : Palette(android.support.v7.graphics.Palette) Bitmap(android.graphics.Bitmap) Callback(com.squareup.picasso.Callback) TextView(android.widget.TextView) ImageView(android.widget.ImageView)

Example 2 with TextView

use of android.widget.TextView in project IceNet by anton46.

the class JsonObjectActivity method onCreate.

@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_json_object);
    final TextView id = (TextView) findViewById(R.id.tv_id);
    final TextView title = (TextView) findViewById(R.id.tv_title);
    final ProgressDialog dialog = new ProgressDialog(this);
    dialog.setMessage("Loading...");
    dialog.show();
    IceNet.connect().createRequest().get().pathUrl("/notes/1").fromJsonObject().mappingInto(Note.class).execute("request_string", new RequestCallback<Note>() {

        @Override
        public void onRequestSuccess(Note note) {
            dialog.dismiss();
            id.setText(note.getId());
            title.setText(note.getTitle());
        }

        @Override
        public void onRequestError(RequestError error) {
            dialog.dismiss();
        }
    });
}
Also used : RequestError(labs.anton.icenet.RequestError) TextView(android.widget.TextView) ProgressDialog(android.app.ProgressDialog)

Example 3 with TextView

use of android.widget.TextView in project IceNet by anton46.

the class StringActivity method onCreate.

@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_string);
    final TextView result = (TextView) findViewById(R.id.tv_result);
    final ProgressDialog dialog = new ProgressDialog(this);
    dialog.setMessage("Loading...");
    dialog.show();
    IceNet.connect().createRequest().get().pathUrl("/string").fromString().execute("request_string", new RequestCallback<String>() {

        @Override
        public void onRequestSuccess(String str) {
            dialog.dismiss();
            result.setText(str);
        }

        @Override
        public void onRequestError(RequestError error) {
            dialog.dismiss();
        }
    });
}
Also used : RequestError(labs.anton.icenet.RequestError) TextView(android.widget.TextView) ProgressDialog(android.app.ProgressDialog)

Example 4 with TextView

use of android.widget.TextView in project android by cSploit.

the class Inspector method onCreate.

@Override
public void onCreate(Bundle savedInstanceState) {
    SharedPreferences themePrefs = getSharedPreferences("THEME", 0);
    Boolean isDark = themePrefs.getBoolean("isDark", false);
    if (isDark)
        setTheme(R.style.DarkTheme);
    else
        setTheme(R.style.AppTheme);
    super.onCreate(savedInstanceState);
    mStartButton = (FloatingActionButton) findViewById(R.id.inspectToggleButton);
    mActivity = (ProgressBar) findViewById(R.id.inspectActivity);
    TextView mDeviceName = (TextView) findViewById(R.id.deviceName);
    mDeviceType = (TextView) findViewById(R.id.deviceType);
    mDeviceOS = (TextView) findViewById(R.id.deviceOS);
    mDeviceServices = (TextView) findViewById(R.id.deviceServices);
    mFocusedScan = System.getCurrentTarget().hasOpenPorts();
    mDeviceName.setText(System.getCurrentTarget().toString());
    if (System.getCurrentTarget().getDeviceType() != null)
        mDeviceType.setText(System.getCurrentTarget().getDeviceType());
    if (System.getCurrentTarget().getDeviceOS() != null)
        mDeviceOS.setText(System.getCurrentTarget().getDeviceOS());
    empty = getText(R.string.unknown).toString();
    // yep, we're on main thread here
    write_services();
    mStartButton.setOnClickListener(new OnClickListener() {

        @Override
        public void onClick(View v) {
            if (mRunning) {
                setStoppedState();
            } else {
                setStartedState();
            }
        }
    });
    mReceiver = new Receiver(System.getCurrentTarget());
}
Also used : SharedPreferences(android.content.SharedPreferences) OnClickListener(android.view.View.OnClickListener) InspectionReceiver(org.csploit.android.tools.NMap.InspectionReceiver) TextView(android.widget.TextView) TextView(android.widget.TextView) View(android.view.View)

Example 5 with TextView

use of android.widget.TextView in project Launcher3 by chislon.

the class LiveWallpaperListAdapter method getView.

public View getView(int position, View convertView, ViewGroup parent) {
    View view;
    if (convertView == null) {
        view = mInflater.inflate(R.layout.wallpaper_picker_live_wallpaper_item, parent, false);
    } else {
        view = convertView;
    }
    WallpaperPickerActivity.setWallpaperItemPaddingToZero((FrameLayout) view);
    LiveWallpaperTile wallpaperInfo = mWallpapers.get(position);
    wallpaperInfo.setView(view);
    ImageView image = (ImageView) view.findViewById(R.id.wallpaper_image);
    ImageView icon = (ImageView) view.findViewById(R.id.wallpaper_icon);
    if (wallpaperInfo.mThumbnail != null) {
        image.setImageDrawable(wallpaperInfo.mThumbnail);
        icon.setVisibility(View.GONE);
    } else {
        icon.setImageDrawable(wallpaperInfo.mInfo.loadIcon(mPackageManager));
        icon.setVisibility(View.VISIBLE);
    }
    TextView label = (TextView) view.findViewById(R.id.wallpaper_item_label);
    label.setText(wallpaperInfo.mInfo.loadLabel(mPackageManager));
    return view;
}
Also used : TextView(android.widget.TextView) ImageView(android.widget.ImageView) ImageView(android.widget.ImageView) View(android.view.View) TextView(android.widget.TextView)

Aggregations

TextView (android.widget.TextView)4784 View (android.view.View)2545 ImageView (android.widget.ImageView)1082 Button (android.widget.Button)423 LinearLayout (android.widget.LinearLayout)417 LayoutInflater (android.view.LayoutInflater)401 ListView (android.widget.ListView)375 Intent (android.content.Intent)367 AdapterView (android.widget.AdapterView)356 ViewGroup (android.view.ViewGroup)314 OnClickListener (android.view.View.OnClickListener)291 Test (org.junit.Test)197 RecyclerView (android.support.v7.widget.RecyclerView)177 ScrollView (android.widget.ScrollView)157 Drawable (android.graphics.drawable.Drawable)152 DialogInterface (android.content.DialogInterface)145 Context (android.content.Context)144 EditText (android.widget.EditText)138 Bundle (android.os.Bundle)133 AlertDialog (android.app.AlertDialog)127