use of android.widget.HorizontalScrollView in project Android-PullToRefresh by chrisbanes.
the class PullToRefreshHorizontalScrollView method createRefreshableView.
@Override
protected HorizontalScrollView createRefreshableView(Context context, AttributeSet attrs) {
HorizontalScrollView scrollView;
if (VERSION.SDK_INT >= VERSION_CODES.GINGERBREAD) {
scrollView = new InternalHorizontalScrollViewSDK9(context, attrs);
} else {
scrollView = new HorizontalScrollView(context, attrs);
}
scrollView.setId(R.id.scrollview);
return scrollView;
}
use of android.widget.HorizontalScrollView in project Android-Terminal-Emulator by jackpal.
the class FSNavigator method fileView.
////////////////////////////////////////////////////////////
private LinearLayout fileView(boolean entryWindow) {
LinearLayout ll = new LinearLayout(context);
ll.setLayoutParams(new LinearLayout.LayoutParams(LinearLayout.LayoutParams.FILL_PARENT, LinearLayout.LayoutParams.WRAP_CONTENT, 1));
ll.setOrientation(LinearLayout.HORIZONTAL);
ll.setGravity(android.view.Gravity.FILL);
final TextView tv;
if (entryWindow) {
tv = new EditText(context);
tv.setHint(getString(R.string.fsnavigator_optional_enter_path));
tv.setLayoutParams(new LinearLayout.LayoutParams(LinearLayout.LayoutParams.FILL_PARENT, LinearLayout.LayoutParams.FILL_PARENT, 2));
tv.setOnKeyListener(new EditText.OnKeyListener() {
public boolean onKey(View v, int keyCode, KeyEvent event) {
if (keyCode == KeyEvent.KEYCODE_ENTER) {
String path = tv.getText().toString();
File file = new File(getCanonicalPath(path));
chdir(file.getParentFile() == null ? file : file.getParentFile());
if (file.isFile()) {
setResult(RESULT_OK, getIntent().setData(Uri.fromFile(file)));
finish();
} else {
chdir(file);
makeView();
}
return (true);
}
return (false);
}
});
ll.addView(tv);
} else {
tv = new TextView(context);
tv.setClickable(true);
tv.setLongClickable(true);
tv.setOnClickListener(fileListener);
tv.setLayoutParams(new LinearLayout.LayoutParams(LinearLayout.LayoutParams.FILL_PARENT, LinearLayout.LayoutParams.FILL_PARENT, 1));
HorizontalScrollView hv = new HorizontalScrollView(context);
hv.setFillViewport(true);
hv.setLayoutParams(new LinearLayout.LayoutParams(LinearLayout.LayoutParams.FILL_PARENT, BUTTON_SIZE, 7));
hv.addView(tv);
ll.addView(hv);
}
tv.setFocusable(true);
tv.setSingleLine();
tv.setTextSize(textLg);
tv.setTypeface(Typeface.SERIF, Typeface.BOLD);
tv.setGravity(Gravity.CENTER_VERTICAL | Gravity.LEFT);
tv.setPadding(10, 5, 10, 5);
//1);
tv.setId(R.id.textview);
return (ll);
}
use of android.widget.HorizontalScrollView in project Android-Terminal-Emulator by jackpal.
the class FSNavigator method directoryView.
////////////////////////////////////////////////////////////
private LinearLayout directoryView(boolean up) {
ImageView b1 = imageViewFolder(up);
TextView tv = new TextView(context);
if (//Gravity.CENTER);
up)
//Gravity.CENTER);
tv.setGravity(Gravity.CENTER_VERTICAL | Gravity.LEFT);
else
tv.setGravity(Gravity.CENTER_VERTICAL | Gravity.LEFT);
tv.setClickable(true);
tv.setLongClickable(true);
tv.setFocusable(true);
tv.setOnClickListener(directoryListener);
tv.setMaxLines(1);
tv.setTextSize(textLg);
tv.setPadding(10, 5, 10, 5);
tv.setId(R.id.textview);
tv.setLayoutParams(new LinearLayout.LayoutParams(LinearLayout.LayoutParams.FILL_PARENT, BUTTON_SIZE, 1));
HorizontalScrollView hv = new HorizontalScrollView(context);
hv.addView(tv);
hv.setFillViewport(true);
hv.setFocusable(true);
hv.setOnClickListener(directoryListener);
hv.setLayoutParams(new LinearLayout.LayoutParams(LinearLayout.LayoutParams.FILL_PARENT, BUTTON_SIZE, 7));
LinearLayout ll = new LinearLayout(context);
ll.setLayoutParams(new LinearLayout.LayoutParams(LinearLayout.LayoutParams.FILL_PARENT, BUTTON_SIZE, 2));
ll.setOrientation(LinearLayout.HORIZONTAL);
ll.setGravity(android.view.Gravity.FILL);
ll.setOnClickListener(directoryListener);
ll.addView(b1);
ll.addView(hv);
return (ll);
}
use of android.widget.HorizontalScrollView in project nmid-headline by miao1007.
the class EditPage method initImageListView.
private void initImageListView() {
final HorizontalScrollView hScrollView = (HorizontalScrollView) findViewByResName("hScrollView");
ImageListResultsCallback callback = new ImageListResultsCallback() {
@Override
public void onFinish(ArrayList<ImageInfo> results) {
if (results == null)
return;
LinearLayout layout = (LinearLayout) findViewByResName("imagesLinearLayout");
for (ImageInfo imageInfo : results) {
if (imageInfo.bitmap == null)
continue;
layout.addView(makeImageItemView(imageInfo));
}
}
};
if (!initImageList(callback)) {
hScrollView.setVisibility(View.GONE);
}
}
use of android.widget.HorizontalScrollView in project XposedInstaller by rovo89.
the class LogsFragment method onCreateView.
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
View v = inflater.inflate(R.layout.tab_logs, container, false);
mTxtLog = (TextView) v.findViewById(R.id.txtLog);
mTxtLog.setTextIsSelectable(true);
mSVLog = (ScrollView) v.findViewById(R.id.svLog);
mHSVLog = (HorizontalScrollView) v.findViewById(R.id.hsvLog);
reloadErrorLog();
/*
View scrollTop = v.findViewById(R.id.scroll_top);
View scrollDown = v.findViewById(R.id.scroll_down);
scrollTop.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
scrollTop();
}
});
scrollDown.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
scrollDown();
}
});
*/
return v;
}
Aggregations