Search in sources :

Example 1 with CircledImageView

use of android.support.wearable.view.CircledImageView in project Talon-for-Twitter by klinker24.

the class ComposeButtonFragment method onCreateView.

@Override
public View onCreateView(LayoutInflater inflater, ViewGroup parent, Bundle savedInstanceState) {
    View view = inflater.inflate(R.layout.fragment_compose_button, parent, false);
    CircledImageView button = (CircledImageView) view.findViewById(R.id.compose_button);
    button.setOnClickListener(new View.OnClickListener() {

        @Override
        public void onClick(View v) {
            ((WearActivity) getActivity()).startComposeRequest();
        }
    });
    SharedPreferences sharedPreferences = PreferenceManager.getDefaultSharedPreferences(getActivity());
    int accentColor = sharedPreferences.getInt(KeyProperties.KEY_ACCENT_COLOR, getResources().getColor(R.color.orange_accent_color));
    button.setCircleColor(accentColor);
    return view;
}
Also used : SharedPreferences(android.content.SharedPreferences) View(android.view.View) CircledImageView(android.support.wearable.view.CircledImageView) CircledImageView(android.support.wearable.view.CircledImageView)

Example 2 with CircledImageView

use of android.support.wearable.view.CircledImageView in project Talon-for-Twitter by klinker24.

the class ExpandableCardFragment method onCreateContentView.

@Override
public View onCreateContentView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
    handler = new Handler();
    View view = inflater.inflate(R.layout.card_expandable, container, false);
    final TextView name = (TextView) view.findViewById(R.id.name);
    final TextView screenname = (TextView) view.findViewById(R.id.screenname);
    final CircledImageView profilePic = (CircledImageView) view.findViewById(R.id.profile_picture);
    text = (TextView) view.findViewById(R.id.text);
    Bundle args = this.getArguments();
    if (args != null) {
        if (args.containsKey(ARG_USER_NAME) && name != null) {
            name.setText(args.getCharSequence(ARG_USER_NAME));
        }
        if (args.containsKey(ARG_SCREENNAME) && screenname != null) {
            screenname.setText("@" + args.getCharSequence(ARG_SCREENNAME));
        }
        if (args.containsKey(ARG_TWEET) && text != null) {
            text.setText(args.getCharSequence(ARG_TWEET));
        }
    }
    setExpansionFactor(currentExpansionFactor);
    view.setOnClickListener(new View.OnClickListener() {

        @Override
        public void onClick(View v) {
            currentExpansionFactor *= 5;
            setExpansionFactor(currentExpansionFactor);
        }
    });
    Thread loader = new Thread(new Runnable() {

        @Override
        public void run() {
            if (getActivity() == null) {
                return;
            }
            File image = new File(getActivity().getCacheDir(), getArguments().getString(ARG_PRO_PIC_URL));
            checkExisting(image, profilePic, 0);
        }
    });
    loader.setPriority(Thread.MIN_PRIORITY);
    loader.start();
    return view;
}
Also used : Bundle(android.os.Bundle) Handler(android.os.Handler) TextView(android.widget.TextView) ImageView(android.widget.ImageView) CircledImageView(android.support.wearable.view.CircledImageView) TextView(android.widget.TextView) View(android.view.View) File(java.io.File) CircledImageView(android.support.wearable.view.CircledImageView)

Example 3 with CircledImageView

use of android.support.wearable.view.CircledImageView in project Talon-for-Twitter by klinker24.

the class FavoriteButtonFragment method onCreateView.

@Override
public View onCreateView(LayoutInflater inflater, ViewGroup parent, Bundle savedInstanceState) {
    View view = inflater.inflate(R.layout.fragment_favorite_button, parent, false);
    CircledImageView button = (CircledImageView) view.findViewById(R.id.favorite_button);
    button.setOnClickListener(new View.OnClickListener() {

        @Override
        public void onClick(View v) {
            ((WearActivity) getActivity()).sendFavoriteRequest(getArguments().getLong(ARG_TWEET_ID));
        }
    });
    SharedPreferences sharedPreferences = PreferenceManager.getDefaultSharedPreferences(getActivity());
    int accentColor = sharedPreferences.getInt(KeyProperties.KEY_ACCENT_COLOR, getResources().getColor(R.color.orange_accent_color));
    button.setCircleColor(accentColor);
    return view;
}
Also used : SharedPreferences(android.content.SharedPreferences) CircledImageView(android.support.wearable.view.CircledImageView) View(android.view.View) CircledImageView(android.support.wearable.view.CircledImageView)

Example 4 with CircledImageView

use of android.support.wearable.view.CircledImageView in project Talon-for-Twitter by klinker24.

the class SettingsButtonFragment method onCreateView.

@Override
public View onCreateView(LayoutInflater inflater, ViewGroup parent, Bundle savedInstanceState) {
    View view = inflater.inflate(R.layout.fragment_settings_button, parent, false);
    CircledImageView button = (CircledImageView) view.findViewById(R.id.settings_button);
    button.setOnClickListener(new View.OnClickListener() {

        @Override
        public void onClick(View v) {
            Intent intent = new Intent(getActivity(), SettingsActivity.class);
            startActivity(intent);
        }
    });
    SharedPreferences sharedPreferences = PreferenceManager.getDefaultSharedPreferences(getActivity());
    int accentColor = sharedPreferences.getInt(KeyProperties.KEY_ACCENT_COLOR, getResources().getColor(R.color.orange_accent_color));
    button.setCircleColor(accentColor);
    return view;
}
Also used : SharedPreferences(android.content.SharedPreferences) Intent(android.content.Intent) View(android.view.View) CircledImageView(android.support.wearable.view.CircledImageView) CircledImageView(android.support.wearable.view.CircledImageView) SettingsActivity(com.klinker.android.twitter.activity.SettingsActivity)

Example 5 with CircledImageView

use of android.support.wearable.view.CircledImageView in project Talon-for-Twitter by klinker24.

the class ReplyButtonFragment method onCreateView.

@Override
public View onCreateView(LayoutInflater inflater, ViewGroup parent, Bundle savedInstanceState) {
    View view = inflater.inflate(R.layout.fragment_reply_button, parent, false);
    CircledImageView button = (CircledImageView) view.findViewById(R.id.reply_button);
    button.setOnClickListener(new View.OnClickListener() {

        @Override
        public void onClick(View v) {
            ((WearActivity) getActivity()).startReplyRequest(getArguments().getString(ARG_USER_SCREENNAME), getArguments().getLong(ARG_TWEET_ID));
        }
    });
    SharedPreferences sharedPreferences = PreferenceManager.getDefaultSharedPreferences(getActivity());
    int accentColor = sharedPreferences.getInt(KeyProperties.KEY_ACCENT_COLOR, getResources().getColor(R.color.orange_accent_color));
    button.setCircleColor(accentColor);
    return view;
}
Also used : SharedPreferences(android.content.SharedPreferences) View(android.view.View) CircledImageView(android.support.wearable.view.CircledImageView) CircledImageView(android.support.wearable.view.CircledImageView)

Aggregations

CircledImageView (android.support.wearable.view.CircledImageView)6 View (android.view.View)6 SharedPreferences (android.content.SharedPreferences)5 Intent (android.content.Intent)1 Bundle (android.os.Bundle)1 Handler (android.os.Handler)1 ImageView (android.widget.ImageView)1 TextView (android.widget.TextView)1 SettingsActivity (com.klinker.android.twitter.activity.SettingsActivity)1 File (java.io.File)1