use of com.androidquery.simplefeed.PQuery in project simplefacebook by androidquery.
the class MenuActivity method initActionBar.
private void initActionBar() {
ActionBar bar = getActionBar();
if (bar == null)
return;
bar.setCustomView(R.layout.action_custom);
bar.setDisplayOptions(ActionBar.DISPLAY_SHOW_CUSTOM);
PQuery aq = aq2.recycle(bar.getCustomView());
currentMode = getMode();
AQUtility.debug("mode", currentMode);
if (currentMode != null) {
List<FeedMode> modes = Arrays.asList(FeedMode.values());
ArrayAdapter<FeedMode> adapter = new ArrayAdapter<FeedMode>(this, R.layout.action_modes, modes);
adapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
currentIndex = modes.indexOf(currentMode);
aq.id(R.id.spinner_action_bar).adapter(adapter).setSelection(currentIndex).visible().itemSelected(this, "modeSelected");
if (!isTablet()) {
aq.id(R.id.text_action_title).gone();
} else {
aq.id(R.id.text_action_title).visible();
}
} else {
aq.id(R.id.text_action_title).visible();
aq.id(R.id.spinner_action_bar).gone();
}
Entity entity = getSource();
if (entity != null) {
String tb = entity.getTb(handle);
if (tb != null) {
aq.id(R.id.image_action_bar).image(tb);
}
aq.id(R.id.text_action_title).text(entity.getName());
} else {
aq.id(R.id.text_action_title).gone();
}
}
use of com.androidquery.simplefeed.PQuery in project simplefacebook by androidquery.
the class FeedFragment method initItemView.
private void initItemView(View view) {
PQuery aq = aq2.recycle(view);
aq.id(R.id.content_tb).clicked(this);
aq.id(R.id.content_name).clicked(this);
aq.id(R.id.button_comment).clicked(this);
aq.id(R.id.tb).clicked(this);
aq.id(R.id.name).clicked(this);
aq.id(R.id.name2).clicked(this);
if (act.isTablet()) {
aq.id(R.id.button_like).clicked(this);
aq.id(R.id.button_source1).clicked(this);
aq.id(R.id.button_source2).clicked(this);
}
}
use of com.androidquery.simplefeed.PQuery in project simplefacebook by androidquery.
the class ImageActivity method initView.
private void initView() {
photos = new ArrayList<FeedItem>();
pv = (PagedView) findViewById(R.id.paged);
pi = (PageIndicator) findViewById(R.id.page_indicator);
pv.setOnPageChangeListener(new OnPagedViewChangeListener() {
@Override
public void onStopTracking(PagedView pagedView) {
}
@Override
public void onStartTracking(PagedView pagedView) {
}
@Override
public void onPageChanged(PagedView pagedView, int previousPage, int newPage) {
pi.setActiveDot(newPage);
}
});
adapter = new PagedAdapter() {
@Override
public View getView(int position, View convertView, ViewGroup parent) {
if (position >= photos.size())
return PageAdapter.getEmptyView(parent);
FeedItem item = photos.get(position);
String url = item.getSource();
if (url == null)
return PageAdapter.getEmptyView(parent);
String name = item.getItemName();
View cached = photoViews.get(url);
if (cached == null) {
convertView = aq.inflate(null, R.layout.item_photo, parent);
photoViews.put(url, convertView);
} else {
convertView = cached;
return convertView;
}
PQuery aq = aq2.recycle(convertView);
aq.id(R.id.web).progress(R.id.progress).invisible();
AQUtility.debug("image load url", url);
aq.webImage(url, true, false, 0xFF000000);
aq.id(R.id.text).text(name, BufferType.NORMAL, true);
convertView.setDrawingCacheEnabled(true);
return convertView;
}
@Override
public long getItemId(int position) {
return position;
}
@Override
public Object getItem(int position) {
return photos.get(position);
}
@Override
public int getCount() {
return photos.size();
}
};
pv.setAdapter(adapter);
}
use of com.androidquery.simplefeed.PQuery in project simplefacebook by androidquery.
the class AdhocActivity method onCreate.
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_adhoc);
aq = new PQuery(this);
aq2 = new PQuery(this);
initView();
}
use of com.androidquery.simplefeed.PQuery in project simplefacebook by androidquery.
the class FriendsActivity method itemClicked.
public void itemClicked(AdapterView<?> parent, View view, int pos, long id) {
Entity entity = getItem(view);
if (entity == null)
return;
if (!selectable) {
FeedActivity.start(this, entity);
} else {
//CheckBox box = (CheckBox) view;
PQuery aq = aq2.recycle(view);
aq.id(R.id.checkbox_select);
boolean checked = aq.isChecked();
aq.checked(!checked);
entity.setChecked(!checked);
}
}
Aggregations