Search in sources :

Example 1 with CircleImageView

use of de.hdodenhof.circleimageview.CircleImageView in project CoCoin by Nightonke.

the class AccountBookTodayViewActivity method onCreate.

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_account_book_today_view);
    SuperToast.cancelAllSuperToasts();
    mContext = this;
    mViewPager = (MaterialViewPager) findViewById(R.id.materialViewPager);
    userName = (TextView) findViewById(R.id.user_name);
    userEmail = (TextView) findViewById(R.id.user_email);
    userName.setTypeface(CoCoinUtil.typefaceLatoRegular);
    userEmail.setTypeface(CoCoinUtil.typefaceLatoLight);
    User user = BmobUser.getCurrentUser(CoCoinApplication.getAppContext(), User.class);
    if (user != null) {
        userName.setText(user.getUsername());
        userEmail.setText(user.getEmail());
    }
    setFonts();
    View view = mViewPager.getRootView();
    title = (TextView) view.findViewById(R.id.logo_white);
    title.setTypeface(CoCoinUtil.typefaceLatoLight);
    title.setText(SettingManager.getInstance().getAccountBookName());
    mViewPager.getPagerTitleStrip().setTypeface(CoCoinUtil.GetTypeface(), Typeface.NORMAL);
    setTitle("");
    toolbar = mViewPager.getToolbar();
    mDrawer = (DrawerLayout) findViewById(R.id.drawer_layout);
    custom = (MaterialRippleLayout) mDrawer.findViewById(R.id.custom_layout);
    tags = (MaterialRippleLayout) mDrawer.findViewById(R.id.tag_layout);
    months = (MaterialRippleLayout) mDrawer.findViewById(R.id.month_layout);
    list = (MaterialRippleLayout) mDrawer.findViewById(R.id.list_layout);
    report = (MaterialRippleLayout) mDrawer.findViewById(R.id.report_layout);
    sync = (MaterialRippleLayout) mDrawer.findViewById(R.id.sync_layout);
    settings = (MaterialRippleLayout) mDrawer.findViewById(R.id.settings_layout);
    help = (MaterialRippleLayout) mDrawer.findViewById(R.id.help_layout);
    feedback = (MaterialRippleLayout) mDrawer.findViewById(R.id.feedback_layout);
    about = (MaterialRippleLayout) mDrawer.findViewById(R.id.about_layout);
    syncIcon = (MaterialIconView) mDrawer.findViewById(R.id.sync_icon);
    setIconEnable(syncIcon, SettingManager.getInstance().getLoggenOn());
    monthExpenseTip = (TextView) mDrawer.findViewById(R.id.month_expense_tip);
    monthExpenseTip.setTypeface(CoCoinUtil.GetTypeface());
    monthExpense = (RiseNumberTextView) mDrawer.findViewById(R.id.month_expense);
    monthExpense.setTypeface(CoCoinUtil.typefaceLatoLight);
    if (SettingManager.getInstance().getIsMonthLimit()) {
        monthExpenseTip.setVisibility(View.VISIBLE);
        monthExpense.setText("0");
    } else {
        monthExpenseTip.setVisibility(View.INVISIBLE);
        monthExpense.setVisibility(View.INVISIBLE);
    }
    if (toolbar != null) {
        setSupportActionBar(toolbar);
        final ActionBar actionBar = getSupportActionBar();
        if (actionBar != null) {
            actionBar.setDisplayHomeAsUpEnabled(true);
            actionBar.setDisplayShowHomeEnabled(true);
            actionBar.setDisplayShowTitleEnabled(true);
            actionBar.setDisplayUseLogoEnabled(false);
            actionBar.setHomeButtonEnabled(true);
        }
    }
    mDrawerToggle = new ActionBarDrawerToggle(this, mDrawer, 0, 0) {

        public void onDrawerClosed(View view) {
            super.onDrawerClosed(view);
            monthExpense.setText("0");
        }

        public void onDrawerOpened(View drawerView) {
            super.onDrawerOpened(drawerView);
            monthExpense.withNumber(RecordManager.getCurrentMonthExpense()).setDuration(500).start();
        }
    };
    mDrawer.setDrawerListener(mDrawerToggle);
    View logo = findViewById(R.id.logo_white);
    if (logo != null) {
        logo.setOnClickListener(new View.OnClickListener() {

            @Override
            public void onClick(View v) {
                mViewPager.notifyHeaderChanged();
            }
        });
    }
    todayModeAdapter = new TodayViewFragmentAdapter(getSupportFragmentManager());
    mViewPager.getViewPager().setOffscreenPageLimit(todayModeAdapter.getCount());
    mViewPager.getViewPager().setAdapter(todayModeAdapter);
    mViewPager.getPagerTitleStrip().setViewPager(mViewPager.getViewPager());
    mViewPager.setMaterialViewPagerListener(new MaterialViewPager.Listener() {

        @Override
        public HeaderDesign getHeaderDesign(int page) {
            return HeaderDesign.fromColorAndDrawable(CoCoinUtil.GetTagColor(page - 2), CoCoinUtil.GetTagDrawable(-3));
        }
    });
    setListeners();
    profileImage = (CircleImageView) mDrawer.findViewById(R.id.profile_image);
    profileImage.setOnClickListener(new View.OnClickListener() {

        @Override
        public void onClick(View v) {
            if (SettingManager.getInstance().getLoggenOn()) {
                CoCoinUtil.showToast(mContext, R.string.change_logo_tip);
            } else {
                CoCoinUtil.showToast(mContext, R.string.login_tip);
            }
        }
    });
    mDemoSlider = (SliderLayout) findViewById(R.id.slider);
    HashMap<String, Integer> urls = CoCoinUtil.GetDrawerTopUrl();
    for (String name : urls.keySet()) {
        CustomSliderView customSliderView = new CustomSliderView(this);
        // initialize a SliderLayout
        customSliderView.image(urls.get(name)).setScaleType(BaseSliderView.ScaleType.Fit);
        mDemoSlider.addSlider(customSliderView);
    }
    mDemoSlider.setPresetTransformer(SliderLayout.Transformer.ZoomOut);
    mDemoSlider.setCustomAnimation(new DescriptionAnimation());
    mDemoSlider.setDuration(4000);
    mDemoSlider.setCustomIndicator((PagerIndicator) findViewById(R.id.custom_indicator));
    loadLogo();
}
Also used : MaterialViewPager(com.github.florent37.materialviewpager.MaterialViewPager) BmobUser(cn.bmob.v3.BmobUser) User(com.nightonke.saver.model.User) HeaderDesign(com.github.florent37.materialviewpager.header.HeaderDesign) ActionBarDrawerToggle(android.support.v7.app.ActionBarDrawerToggle) CustomSliderView(com.nightonke.saver.ui.CustomSliderView) CircleImageView(de.hdodenhof.circleimageview.CircleImageView) RiseNumberTextView(com.nightonke.saver.ui.RiseNumberTextView) View(android.view.View) TextView(android.widget.TextView) BaseSliderView(com.daimajia.slider.library.SliderTypes.BaseSliderView) CustomSliderView(com.nightonke.saver.ui.CustomSliderView) MaterialIconView(net.steamcrafted.materialiconlib.MaterialIconView) TodayViewFragmentAdapter(com.nightonke.saver.adapter.TodayViewFragmentAdapter) DescriptionAnimation(com.daimajia.slider.library.Animations.DescriptionAnimation) ActionBar(android.support.v7.app.ActionBar)

Example 2 with CircleImageView

use of de.hdodenhof.circleimageview.CircleImageView in project CoCoin by Nightonke.

the class AccountBookMonthViewActivity method onCreate.

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    mContext = this;
    setContentView(R.layout.activity_account_book_month_view);
    userName = (TextView) findViewById(R.id.user_name);
    userEmail = (TextView) findViewById(R.id.user_email);
    userName.setTypeface(CoCoinUtil.typefaceLatoRegular);
    userEmail.setTypeface(CoCoinUtil.typefaceLatoLight);
    User user = BmobUser.getCurrentUser(CoCoinApplication.getAppContext(), User.class);
    if (user != null) {
        userName.setText(user.getUsername());
        userEmail.setText(user.getEmail());
    }
    mViewPager = (MaterialViewPager) findViewById(R.id.materialViewPager);
    View view = mViewPager.getRootView();
    TextView title = (TextView) view.findViewById(R.id.logo_white);
    title.setTypeface(CoCoinUtil.typefaceLatoLight);
    title.setText(SettingManager.getInstance().getAccountBookName());
    mViewPager.getPagerTitleStrip().setTypeface(CoCoinUtil.GetTypeface(), Typeface.NORMAL);
    setTitle("");
    toolbar = mViewPager.getToolbar();
    mDrawer = (DrawerLayout) findViewById(R.id.drawer_layout);
    if (toolbar != null) {
        setSupportActionBar(toolbar);
        final ActionBar actionBar = getSupportActionBar();
        if (actionBar != null) {
            actionBar.setDisplayHomeAsUpEnabled(true);
            actionBar.setDisplayShowHomeEnabled(true);
            actionBar.setDisplayShowTitleEnabled(true);
            actionBar.setDisplayUseLogoEnabled(false);
            actionBar.setHomeButtonEnabled(true);
        }
    }
    mDrawerToggle = new ActionBarDrawerToggle(this, mDrawer, 0, 0);
    mDrawer.setDrawerListener(mDrawerToggle);
    View logo = findViewById(R.id.logo_white);
    if (logo != null) {
        logo.setOnClickListener(new View.OnClickListener() {

            @Override
            public void onClick(View v) {
                mViewPager.notifyHeaderChanged();
            }
        });
    }
    monthModeAdapter = new MonthViewFragmentAdapter(getSupportFragmentManager());
    mViewPager.getViewPager().setOffscreenPageLimit(monthModeAdapter.getCount());
    mViewPager.getViewPager().setAdapter(monthModeAdapter);
    mViewPager.getPagerTitleStrip().setViewPager(mViewPager.getViewPager());
    if (monthModeAdapter.getCount() == 1) {
        mViewPager.getPagerTitleStrip().setVisibility(View.INVISIBLE);
    }
    mViewPager.setMaterialViewPagerListener(new MaterialViewPager.Listener() {

        @Override
        public HeaderDesign getHeaderDesign(int page) {
            return HeaderDesign.fromColorAndDrawable(CoCoinUtil.GetTagColor(RecordManager.TAGS.get(page).getId()), CoCoinUtil.GetTagDrawable(-3));
        }
    });
    recyclerView = (RecyclerView) mDrawer.findViewById(R.id.recycler_view);
    drawerMonthViewRecyclerViewAdapter = new DrawerMonthViewRecyclerViewAdapter(mContext);
    recyclerView.setAdapter(drawerMonthViewRecyclerViewAdapter);
    recyclerView.setHasFixedSize(true);
    recyclerView.setLayoutManager(new LinearLayoutManager(mContext));
    recyclerView.setItemAnimator(new DefaultItemAnimator());
    drawerMonthViewRecyclerViewAdapter.SetOnItemClickListener(new OnItemClickListener() {

        @Override
        public void onItemClick(View view, int position) {
            mViewPager.getViewPager().setCurrentItem(position);
            final Handler handler = new Handler();
            handler.postDelayed(new Runnable() {

                @Override
                public void run() {
                    mDrawer.closeDrawers();
                }
            }, 700);
        }
    });
    profileImage = (CircleImageView) mDrawer.findViewById(R.id.profile_image);
    profileImage.setOnClickListener(new View.OnClickListener() {

        @Override
        public void onClick(View v) {
            if (SettingManager.getInstance().getLoggenOn()) {
                CoCoinUtil.showToast(mContext, R.string.change_logo_tip);
            } else {
                CoCoinUtil.showToast(mContext, R.string.login_tip);
            }
        }
    });
    mDemoSlider = (SliderLayout) findViewById(R.id.slider);
    HashMap<String, Integer> urls = CoCoinUtil.GetDrawerTopUrl();
    for (String name : urls.keySet()) {
        CustomSliderView customSliderView = new CustomSliderView(this);
        // initialize a SliderLayout
        customSliderView.image(urls.get(name)).setScaleType(BaseSliderView.ScaleType.Fit);
        mDemoSlider.addSlider(customSliderView);
    }
    mDemoSlider.setPresetTransformer(SliderLayout.Transformer.ZoomOut);
    mDemoSlider.setCustomAnimation(new DescriptionAnimation());
    mDemoSlider.setDuration(4000);
    mDemoSlider.setCustomIndicator((PagerIndicator) findViewById(R.id.custom_indicator));
    loadLogo();
}
Also used : MaterialViewPager(com.github.florent37.materialviewpager.MaterialViewPager) DrawerMonthViewRecyclerViewAdapter(com.nightonke.saver.adapter.DrawerMonthViewRecyclerViewAdapter) User(com.nightonke.saver.model.User) BmobUser(cn.bmob.v3.BmobUser) OnItemClickListener(com.nightonke.saver.adapter.DrawerMonthViewRecyclerViewAdapter.OnItemClickListener) HeaderDesign(com.github.florent37.materialviewpager.header.HeaderDesign) ActionBarDrawerToggle(android.support.v7.app.ActionBarDrawerToggle) Handler(android.os.Handler) CustomSliderView(com.nightonke.saver.ui.CustomSliderView) LinearLayoutManager(android.support.v7.widget.LinearLayoutManager) CircleImageView(de.hdodenhof.circleimageview.CircleImageView) CustomSliderView(com.nightonke.saver.ui.CustomSliderView) View(android.view.View) RecyclerView(android.support.v7.widget.RecyclerView) TextView(android.widget.TextView) BaseSliderView(com.daimajia.slider.library.SliderTypes.BaseSliderView) MonthViewFragmentAdapter(com.nightonke.saver.adapter.MonthViewFragmentAdapter) DefaultItemAnimator(android.support.v7.widget.DefaultItemAnimator) DescriptionAnimation(com.daimajia.slider.library.Animations.DescriptionAnimation) TextView(android.widget.TextView) ActionBar(android.support.v7.app.ActionBar)

Example 3 with CircleImageView

use of de.hdodenhof.circleimageview.CircleImageView in project HumaneApp by Ganesh1010.

the class UserProfileActivity method onCreate.

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_user_profile);
    toolbar = (Toolbar) findViewById(R.id.toolbar_user_profile);
    setSupportActionBar(toolbar);
    getSupportActionBar().setDisplayHomeAsUpEnabled(true);
    getSupportActionBar().setTitle("");
    // Back Arrow
    final Drawable upArrow = ContextCompat.getDrawable(this, R.drawable.abc_ic_ab_back_material);
    upArrow.setColorFilter(ContextCompat.getColor(this, R.color.colorTextIcons), PorterDuff.Mode.SRC_ATOP);
    getSupportActionBar().setHomeAsUpIndicator(upArrow);
    toolbar.setNavigationOnClickListener(new View.OnClickListener() {

        @Override
        public void onClick(View v) {
            onBackPressed();
        }
    });
    // Focusing up the page
    scrollView = ((ScrollView) findViewById(R.id.scrollview_user_profile));
    scrollView.post(new Runnable() {

        @Override
        public void run() {
            scrollView.fullScroll(ScrollView.FOCUS_UP);
        }
    });
    // Edit button functionality
    editImageButton = (CircleImageView) findViewById(R.id.edit_imagebutton_user_profile);
    editImageButton.setOnClickListener(UserProfileActivity.this);
    // My Organisation Button
    myOrgButton = (Button) findViewById(R.id.my_org_button_edit_profile);
    myOrgButton.setOnClickListener(UserProfileActivity.this);
}
Also used : ScrollView(android.widget.ScrollView) Drawable(android.graphics.drawable.Drawable) CircleImageView(de.hdodenhof.circleimageview.CircleImageView) RecyclerView(android.support.v7.widget.RecyclerView) ScrollView(android.widget.ScrollView) View(android.view.View)

Example 4 with CircleImageView

use of de.hdodenhof.circleimageview.CircleImageView in project instructure-android by instructure.

the class CarouselPagerAdapter method instantiateItem.

@Override
public Object instantiateItem(ViewGroup container, final int position) {
    View itemView = mLayoutInflater.inflate(R.layout.carousel_item_view, container, false);
    CircleImageView avatarView = (CircleImageView) itemView.findViewById(R.id.avatar);
    Utils.testSafeContentDescription(avatarView, String.format(mContext.getString(R.string.avatar_content_desc), position), mUserList.get(position).getStudentName(), BuildConfig.IS_TESTING);
    itemView.setTag(position);
    final Drawable userIcon = ColorUtils.colorIt(mContext, Color.WHITE, R.drawable.ic_cv_user);
    Picasso.with(mContext).load(mUserList.get(position).getAvatarUrl()).placeholder(userIcon).error(userIcon).fit().into(avatarView);
    avatarView.setOnClickListener(new View.OnClickListener() {

        @Override
        public void onClick(View view) {
            if (mContext instanceof ViewPager.OnPageChangeListener) {
                ((ViewPager.OnPageChangeListener) mContext).onPageSelected(position);
            }
        }
    });
    container.addView(itemView);
    return itemView;
}
Also used : CircleImageView(de.hdodenhof.circleimageview.CircleImageView) Drawable(android.graphics.drawable.Drawable) CircleImageView(de.hdodenhof.circleimageview.CircleImageView) View(android.view.View) ViewPager(android.support.v4.view.ViewPager)

Example 5 with CircleImageView

use of de.hdodenhof.circleimageview.CircleImageView in project instructure-android by instructure.

the class HomeActivity method initNavigationDrawer.

public void initNavigationDrawer() {
    // User Data
    avatar = (CircleImageView) findViewById(R.id.profile_image);
    userName = (HelveticaTextView) findViewById(R.id.userName);
    aboutButton = (RelativeLayout) findViewById(R.id.aboutButton);
    helpButton = (RelativeLayout) findViewById(R.id.helpButton);
    reportProblemButton = (RelativeLayout) findViewById(R.id.reportProblemButton);
    navigationHeader = (LinearLayout) findViewById(R.id.navigationHeader);
    UserAPI.getSelf(userCallback);
    intAboutPage();
    initSettingsListeners();
    initLogoutButton();
    initMasquerading();
    // Help Button
    helpButton.setOnClickListener(new View.OnClickListener() {

        @Override
        public void onClick(View v) {
            startActivity(InternalWebviewActivity.createIntent(getContext(), com.instructure.pandautils.utils.Const.CANVAS_USER_GUIDES, false));
            overridePendingTransition(R.anim.slide_down, 0);
        }
    });
    reportProblemButton.setOnClickListener(new View.OnClickListener() {

        @Override
        public void onClick(View v) {
            ZendeskDialogStyled dialog = new ZendeskDialogStyled();
            dialog.show(getSupportFragmentManager(), ZendeskDialogStyled.TAG);
        }
    });
}
Also used : ZendeskDialogStyled(com.instructure.loginapi.login.api.zendesk.utilities.ZendeskDialogStyled) HelveticaTextView(com.instructure.speedgrader.views.HelveticaTextView) ImageView(android.widget.ImageView) CircleImageView(de.hdodenhof.circleimageview.CircleImageView) View(android.view.View) TextView(android.widget.TextView) ScrollView(android.widget.ScrollView)

Aggregations

CircleImageView (de.hdodenhof.circleimageview.CircleImageView)30 View (android.view.View)27 TextView (android.widget.TextView)23 ImageView (android.widget.ImageView)13 ActionBar (android.support.v7.app.ActionBar)6 AdapterView (android.widget.AdapterView)6 ListView (android.widget.ListView)6 Intent (android.content.Intent)5 Bitmap (android.graphics.Bitmap)5 ActionBarDrawerToggle (android.support.v7.app.ActionBarDrawerToggle)5 RecyclerView (android.support.v7.widget.RecyclerView)5 BmobUser (cn.bmob.v3.BmobUser)4 DescriptionAnimation (com.daimajia.slider.library.Animations.DescriptionAnimation)4 BaseSliderView (com.daimajia.slider.library.SliderTypes.BaseSliderView)4 User (com.nightonke.saver.model.User)4 CustomSliderView (com.nightonke.saver.ui.CustomSliderView)4 IntentFilter (android.content.IntentFilter)3 ColorDrawable (android.graphics.drawable.ColorDrawable)3 Handler (android.os.Handler)3 LinearLayoutManager (android.support.v7.widget.LinearLayoutManager)3