Skip to content

Commit

Permalink
update ui
Browse files Browse the repository at this point in the history
  • Loading branch information
woioiow committed Jan 15, 2021
1 parent bbae1e9 commit 41ec467
Show file tree
Hide file tree
Showing 3 changed files with 61 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,44 @@
import android.widget.HorizontalScrollView;
import android.widget.ScrollView;

import com.moioio.android.easyui.UI;
import com.moioio.android.easyui.UIConf;
import com.moioio.android.util.ViewUtil;

public class MyHorizontalScrollView extends HorizontalScrollView {

MyLinearLayout layout;
public MyHorizontalScrollView(Context context) {
super(context);
ViewUtil.setViewID(this);
layout = new MyLinearLayout(context);
layout.setOrientation(UI.HORIZONTAL);
this.addView(layout);
}

public void addView(View child) {
this.removeAllViews();
super.addView(child);
}

public void addItem(View child) {
layout.addView(child);
}

public int getItemCount() {
return layout.getChildCount();
}

public View getItemAt(int index) {
return layout.getChildAt(index);
}

public void removeItem(View view) {
layout.removeView(view);
}




private MyLayout MyLayout;
public MyLayout makeLayout(int width, int height)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,41 @@
import android.widget.ImageView;
import android.widget.ScrollView;

import com.moioio.android.easyui.UI;
import com.moioio.android.easyui.UIConf;
import com.moioio.android.util.ViewUtil;

public class MyScrollView extends ScrollView {


MyLinearLayout layout;
public MyScrollView(Context context) {
super(context);
ViewUtil.setViewID(this);
layout = new MyLinearLayout(context);
layout.setOrientation(UI.VERTICAL);
this.addView(layout);
}

public void addView(View child) {
this.removeAllViews();
super.addView(child);
}

public void addItem(View child) {
layout.addView(child);
}

public int getItemCount() {
return layout.getChildCount();
}

public View getItemAt(int index) {
return layout.getChildAt(index);
}

public void removeItem(View view) {
layout.removeView(view);
}


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,4 +80,10 @@ public Context getContext() {
public void setLoaded(boolean loaded) {
isLoaded = loaded;
}


public void loadOK() {
setLoaded(true);
}

}

0 comments on commit 41ec467

Please sign in to comment.