Search in sources :

Example 1 with TitleTextItem

use of com.abewy.klyph.items.TitleTextItem in project Klyph by jonathangerbaud.

the class TitleTextItemAdapter method mergeViewWithData.

@Override
protected void mergeViewWithData(View view, GraphObject data) {
    TitleTextItemHolder holder = (TitleTextItemHolder) view.getTag();
    TitleTextItem item = (TitleTextItem) data;
    holder.getTitle().setText(item.getTitle());
    holder.getText().setAutoLinkMask(Linkify.ALL);
    holder.getText().setText(item.getText());
    holder.getShadow().setVisibility(item.getShadow() == true ? View.VISIBLE : View.GONE);
}
Also used : TitleTextItem(com.abewy.klyph.items.TitleTextItem) TitleTextItemHolder(com.abewy.android.apps.klyph.adapter.holder.TitleTextItemHolder)

Example 2 with TitleTextItem

use of com.abewy.klyph.items.TitleTextItem in project Klyph by jonathangerbaud.

the class PageAbout method addTitleTextItem.

private void addTitleTextItem(List<GraphObject> list, String value, int resTitle, boolean shadow) {
    if (isNotEmpty(value)) {
        TitleTextItem item = new TitleTextItem();
        item.setTitle(getResources().getString(resTitle));
        item.setText(value);
        item.setShadow(true);
        list.add(item);
    }
}
Also used : TitleTextItem(com.abewy.klyph.items.TitleTextItem)

Example 3 with TitleTextItem

use of com.abewy.klyph.items.TitleTextItem in project Klyph by jonathangerbaud.

the class UserAbout method populate.

@Override
protected void populate(List<GraphObject> data) {
    if (data.size() > 0) {
        User user = (User) data.get(0);
        data.remove(0);
        if (user.getAbout_me() != null && user.getAbout_me().length() > 0) {
            TitleTextItem item = new TitleTextItem();
            item.setTitle(getResources().getString(R.string.user_about));
            item.setText(user.getAbout_me());
            item.setShadow(true);
            data.add(item);
        }
        HashMap<String, String> basicInfo = new HashMap<String, String>();
        basicInfo.put(getResources().getString(R.string.user_birthday), user.getBirthday());
        basicInfo.put(getResources().getString(R.string.user_sex), user.getSex());
        basicInfo.put(getResources().getString(R.string.user_meeting_sex), user.getMeeting_sex());
        basicInfo.put(getResources().getString(R.string.user_relationship_status), user.getRelationship_status());
        basicInfo.put(getResources().getString(R.string.user_religion), user.getReligion());
        basicInfo.put(getResources().getString(R.string.user_political), user.getPolitical());
        addItemsForMap(getResources().getString(R.string.general_infos), basicInfo, data);
        HashMap<String, String> coords = new HashMap<String, String>();
        // coords.put(getResources().getString(R.string.user_phones), user.get);
        coords.put(getResources().getString(R.string.user_address), user.getCurrent_location().getName());
        coords.put(getResources().getString(R.string.user_email), user.getEmail());
        // coords.put(getResources().getString(R.string.user_networks),
        // user.getNetwork());
        coords.put(getResources().getString(R.string.user_website), user.getWebsite());
        addItemsForMap(getResources().getString(R.string.coordinates), coords, data);
        HashMap<String, String> others = new HashMap<String, String>();
        others.put(getResources().getString(R.string.user_activities), user.getActivities());
        others.put(getResources().getString(R.string.user_books), user.getBooks());
        // others.put(getResources().getString(R.string.user_inspirational_people),
        // user.getInpirational_people());
        others.put(getResources().getString(R.string.user_interests), user.getInterests());
        others.put(getResources().getString(R.string.user_movies), user.getMovies());
        others.put(getResources().getString(R.string.user_music), user.getMusic());
        // others.put(getResources().getString(R.string.user_sports),
        // user.getSports());
        others.put(getResources().getString(R.string.user_tv), user.getTv());
        others.put(getResources().getString(R.string.user_quotes), user.getQuotes());
        addItemsForMap(getResources().getString(R.string.others), others, data);
        if (user.getFamily().size() > 0) {
            Title title = new Title();
            title.setName(getResources().getString(R.string.family));
            data.add(title);
            for (Relative relative : user.getFamily()) {
                data.add(relative);
            }
            Relative last = (Relative) data.get(data.size() - 1);
            last.setShadow(true);
        }
        if (user.getWork().size() > 0) {
            Title title = new Title();
            title.setName(getResources().getString(R.string.work));
            data.add(title);
            for (Work work : user.getWork()) {
                data.add(work);
            }
            Work last = (Work) data.get(data.size() - 1);
            last.setShadow(true);
        }
        if (user.getEducation().size() > 0) {
            Title title = new Title();
            title.setName(getResources().getString(R.string.education));
            data.add(title);
            for (Education education : user.getEducation()) {
                data.add(education);
            }
        }
    }
    super.populate(data);
    setNoMoreData(true);
}
Also used : TitleTextItem(com.abewy.klyph.items.TitleTextItem) Relative(com.abewy.android.apps.klyph.core.fql.User.Relative) User(com.abewy.android.apps.klyph.core.fql.User) HashMap(java.util.HashMap) Education(com.abewy.android.apps.klyph.core.fql.User.Education) Work(com.abewy.android.apps.klyph.core.fql.User.Work) Title(com.abewy.klyph.items.Title)

Aggregations

TitleTextItem (com.abewy.klyph.items.TitleTextItem)3 TitleTextItemHolder (com.abewy.android.apps.klyph.adapter.holder.TitleTextItemHolder)1 User (com.abewy.android.apps.klyph.core.fql.User)1 Education (com.abewy.android.apps.klyph.core.fql.User.Education)1 Relative (com.abewy.android.apps.klyph.core.fql.User.Relative)1 Work (com.abewy.android.apps.klyph.core.fql.User.Work)1 Title (com.abewy.klyph.items.Title)1 HashMap (java.util.HashMap)1