Java Code Examples for android.widget.LinearLayout#setAnimation()

The following examples show how to use android.widget.LinearLayout#setAnimation() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: PlatformPage.java    From POCenter with MIT License 4 votes vote down vote up
public void onCreate() {
	activity.getWindow().setBackgroundDrawable(new ColorDrawable(0x4c000000));
	initAnims();

	LinearLayout llPage = new LinearLayout(activity);
	llPage.setOrientation(LinearLayout.VERTICAL);
	activity.setContentView(llPage);

	TextView vTop = new TextView(activity);
	LinearLayout.LayoutParams lp = new LinearLayout.LayoutParams(
			LayoutParams.MATCH_PARENT, LayoutParams.WRAP_CONTENT);
	lp.weight = 1;
	vTop.setOnClickListener(new OnClickListener() {
		public void onClick(View v) {
			finish();
		}
	});
	llPage.addView(vTop, lp);

	llPanel = new LinearLayout(activity);
	llPanel.setOrientation(LinearLayout.VERTICAL);
	lp = new LinearLayout.LayoutParams(
			LayoutParams.MATCH_PARENT, LayoutParams.WRAP_CONTENT);
	llPanel.setAnimation(animShow);
	llPage.addView(llPanel, lp);

	MobViewPager mvp = new MobViewPager(activity);
	ArrayList<Object> cells = collectCells();
	PlatformPageAdapter adapter = newAdapter(cells);
	lp = new LinearLayout.LayoutParams(LayoutParams.MATCH_PARENT, adapter.getPanelHeight());
	llPanel.addView(mvp, lp);

	IndicatorView vInd = new IndicatorView(activity);
	lp = new LinearLayout.LayoutParams(LayoutParams.MATCH_PARENT, adapter.getBottomHeight());
	llPanel.addView(vInd, lp);

	vInd.setScreenCount(adapter.getCount());
	vInd.onScreenChange(0, 0);
	adapter.setIndicator(vInd);
	mvp.setAdapter(adapter);
}
 
Example 2
Source File: PlatformPage.java    From YiZhi with Apache License 2.0 4 votes vote down vote up
public void onCreate() {
	activity.getWindow().setBackgroundDrawable(new ColorDrawable(0x4c000000));
	initAnims();

	LinearLayout llPage = new LinearLayout(activity);
	llPage.setOrientation(LinearLayout.VERTICAL);
	activity.setContentView(llPage);

	TextView vTop = new TextView(activity);
	LinearLayout.LayoutParams lp = new LinearLayout.LayoutParams(
			LayoutParams.MATCH_PARENT, LayoutParams.WRAP_CONTENT);
	lp.weight = 1;
	vTop.setOnClickListener(new OnClickListener() {
		public void onClick(View v) {
			finish();
		}
	});
	llPage.addView(vTop, lp);

	llPanel = new LinearLayout(activity);
	llPanel.setOrientation(LinearLayout.VERTICAL);
	lp = new LinearLayout.LayoutParams(
			LayoutParams.MATCH_PARENT, LayoutParams.WRAP_CONTENT);
	llPanel.setAnimation(animShow);
	llPage.addView(llPanel, lp);

	MobViewPager mvp = new MobViewPager(activity);
	ArrayList<Object> cells = collectCells();
	PlatformPageAdapter adapter = newAdapter(cells);
	lp = new LinearLayout.LayoutParams(LayoutParams.MATCH_PARENT, adapter.getPanelHeight());
	llPanel.addView(mvp, lp);

	IndicatorView vInd = new IndicatorView(activity);
	lp = new LinearLayout.LayoutParams(LayoutParams.MATCH_PARENT, adapter.getBottomHeight());
	llPanel.addView(vInd, lp);

	vInd.setScreenCount(adapter.getCount());
	vInd.onScreenChange(0, 0);
	adapter.setIndicator(vInd);
	mvp.setAdapter(adapter);
}
 
Example 3
Source File: PlatformPage.java    From enjoyshop with Apache License 2.0 4 votes vote down vote up
public void onCreate() {
    //		activity.getWindow().setBackgroundDrawable(new ColorDrawable(0x4c000000));
    initAnims();

    LinearLayout llPage = new LinearLayout(activity);
    llPage.setOrientation(LinearLayout.VERTICAL);
    activity.setContentView(llPage);

    TextView vTop = new TextView(activity);
    LinearLayout.LayoutParams lp = new LinearLayout.LayoutParams(
            LayoutParams.MATCH_PARENT, LayoutParams.WRAP_CONTENT);
    lp.weight = 1;
    vTop.setOnClickListener(new OnClickListener() {
        public void onClick(View v) {
            finish();
        }
    });
    llPage.addView(vTop, lp);

    llPanel = new LinearLayout(activity);
    llPanel.setOrientation(LinearLayout.VERTICAL);
    lp = new LinearLayout.LayoutParams(
            LayoutParams.MATCH_PARENT, LayoutParams.WRAP_CONTENT);
    llPanel.setAnimation(animShow);
    llPage.addView(llPanel, lp);

    MobViewPager mvp = new MobViewPager(activity);
    ArrayList<Object> cells = collectCells();
    PlatformPageAdapter adapter = newAdapter(cells);
    lp = new LinearLayout.LayoutParams(LayoutParams.MATCH_PARENT, adapter.getPanelHeight());
    llPanel.addView(mvp, lp);

    IndicatorView vInd = new IndicatorView(activity);
    lp = new LinearLayout.LayoutParams(LayoutParams.MATCH_PARENT, adapter.getBottomHeight());
    llPanel.addView(vInd, lp);

    vInd.setScreenCount(adapter.getCount());
    vInd.onScreenChange(0, 0);
    adapter.setIndicator(vInd);
    mvp.setAdapter(adapter);


    /**
     * 添加 取消分享按钮
     */

    lp = new LinearLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, 150);
    lp.setMargins(0, 0, 0, 0);
    LinearLayout buttonLayout2 = new LinearLayout(activity);
    buttonLayout2.setBackgroundColor(Color.WHITE);

    LinearLayout.LayoutParams lp22 = new LinearLayout.LayoutParams(ViewGroup.LayoutParams
            .MATCH_PARENT, 110);
    lp22.setMargins(20, 20, 20, 20);
    //        Button button2 = new Button(activity);
    //        button2.setText("取消分享");
    //        button2.setTextSize(16);
    //        button2.setTextColor(Color.BLACK);
    //        button2.setBackgroundColor(Color.GREEN);
    //        button2.setOnClickListener(new OnClickListener() {
    //
    //            @Override
    //            public void onClick(View v) {
    //                finish();
    //            }
    //        });
    //
    //
    //        buttonLayout2.addView(button2, lp22);
    //        llPanel.addView(buttonLayout2, lp);


    ImageView imgView = getImageView();
    imgView.setImageResource(R.drawable.icon_delete_32);
    imgView.setOnClickListener(new OnClickListener() {
        @Override
        public void onClick(View view) {
            finish();
        }
    });

    buttonLayout2.addView(imgView, lp22);
    llPanel.addView(buttonLayout2, lp);

}
 
Example 4
Source File: PlatformPage.java    From LiuAGeAndroid with MIT License 4 votes vote down vote up
public void onCreate() {
	activity.getWindow().setBackgroundDrawable(new ColorDrawable(0x4c000000));
	initAnims();

	LinearLayout llPage = new LinearLayout(activity);
	llPage.setOrientation(LinearLayout.VERTICAL);
	activity.setContentView(llPage);

	TextView vTop = new TextView(activity);
	LinearLayout.LayoutParams lp = new LinearLayout.LayoutParams(
			LayoutParams.MATCH_PARENT, LayoutParams.WRAP_CONTENT);
	lp.weight = 1;
	vTop.setOnClickListener(new OnClickListener() {
		public void onClick(View v) {
			finish();
		}
	});
	llPage.addView(vTop, lp);

	llPanel = new LinearLayout(activity);
	llPanel.setOrientation(LinearLayout.VERTICAL);
	lp = new LinearLayout.LayoutParams(
			LayoutParams.MATCH_PARENT, LayoutParams.WRAP_CONTENT);
	llPanel.setAnimation(animShow);
	llPage.addView(llPanel, lp);

	MobViewPager mvp = new MobViewPager(activity);
	ArrayList<Object> cells = collectCells();
	PlatformPageAdapter adapter = newAdapter(cells);
	lp = new LinearLayout.LayoutParams(LayoutParams.MATCH_PARENT, adapter.getPanelHeight());
	llPanel.addView(mvp, lp);

	IndicatorView vInd = new IndicatorView(activity);
	lp = new LinearLayout.LayoutParams(LayoutParams.MATCH_PARENT, adapter.getBottomHeight());
	llPanel.addView(vInd, lp);

	vInd.setScreenCount(adapter.getCount());
	vInd.onScreenChange(0, 0);
	adapter.setIndicator(vInd);
	mvp.setAdapter(adapter);
}
 
Example 5
Source File: PlatformPage.java    From Social with Apache License 2.0 4 votes vote down vote up
public void onCreate() {
	activity.getWindow().setBackgroundDrawable(new ColorDrawable(0x4c000000));
	initAnims();

	LinearLayout llPage = new LinearLayout(activity);
	llPage.setOrientation(LinearLayout.VERTICAL);
	activity.setContentView(llPage);

	TextView vTop = new TextView(activity);
	LinearLayout.LayoutParams lp = new LinearLayout.LayoutParams(
			LayoutParams.MATCH_PARENT, LayoutParams.WRAP_CONTENT);
	lp.weight = 1;
	vTop.setOnClickListener(new OnClickListener() {
		public void onClick(View v) {
			finish();
		}
	});
	llPage.addView(vTop, lp);

	llPanel = new LinearLayout(activity);
	llPanel.setOrientation(LinearLayout.VERTICAL);
	lp = new LinearLayout.LayoutParams(
			LayoutParams.MATCH_PARENT, LayoutParams.WRAP_CONTENT);
	llPanel.setAnimation(animShow);
	llPage.addView(llPanel, lp);

	MobViewPager mvp = new MobViewPager(activity);
	ArrayList<Object> cells = collectCells();
	PlatformPageAdapter adapter = newAdapter(cells);
	lp = new LinearLayout.LayoutParams(LayoutParams.MATCH_PARENT, adapter.getPanelHeight());
	llPanel.addView(mvp, lp);

	IndicatorView vInd = new IndicatorView(activity);
	lp = new LinearLayout.LayoutParams(LayoutParams.MATCH_PARENT, adapter.getBottomHeight());
	llPanel.addView(vInd, lp);

	vInd.setScreenCount(adapter.getCount());
	vInd.onScreenChange(0, 0);
	adapter.setIndicator(vInd);
	mvp.setAdapter(adapter);
}
 
Example 6
Source File: PlatformPage.java    From Mobike with Apache License 2.0 4 votes vote down vote up
public void onCreate() {
	activity.getWindow().setBackgroundDrawable(new ColorDrawable(0x4c000000));
	initAnims();

	LinearLayout llPage = new LinearLayout(activity);
	llPage.setOrientation(LinearLayout.VERTICAL);
	activity.setContentView(llPage);

	TextView vTop = new TextView(activity);
	LinearLayout.LayoutParams lp = new LinearLayout.LayoutParams(
			LayoutParams.MATCH_PARENT, LayoutParams.WRAP_CONTENT);
	lp.weight = 1;
	vTop.setOnClickListener(new OnClickListener() {
		public void onClick(View v) {
			finish();
		}
	});
	llPage.addView(vTop, lp);

	llPanel = new LinearLayout(activity);
	llPanel.setOrientation(LinearLayout.VERTICAL);
	lp = new LinearLayout.LayoutParams(
			LayoutParams.MATCH_PARENT, LayoutParams.WRAP_CONTENT);
	llPanel.setAnimation(animShow);
	llPage.addView(llPanel, lp);

	MobViewPager mvp = new MobViewPager(activity);
	ArrayList<Object> cells = collectCells();
	PlatformPageAdapter adapter = newAdapter(cells);
	lp = new LinearLayout.LayoutParams(LayoutParams.MATCH_PARENT, adapter.getPanelHeight());
	llPanel.addView(mvp, lp);

	com.sharesdk.onekeyshare.themes.classic.IndicatorView vInd = new com.sharesdk.onekeyshare.themes.classic.IndicatorView(activity);
	lp = new LinearLayout.LayoutParams(LayoutParams.MATCH_PARENT, adapter.getBottomHeight());
	llPanel.addView(vInd, lp);

	vInd.setScreenCount(adapter.getCount());
	vInd.onScreenChange(0, 0);
	adapter.setIndicator(vInd);
	mvp.setAdapter(adapter);
}
 
Example 7
Source File: PlatformPage.java    From LQRWeChat with MIT License 4 votes vote down vote up
public void onCreate() {
	activity.getWindow().setBackgroundDrawable(new ColorDrawable(0x4c000000));
	initAnims();

	LinearLayout llPage = new LinearLayout(activity);
	llPage.setOrientation(LinearLayout.VERTICAL);
	activity.setContentView(llPage);

	TextView vTop = new TextView(activity);
	LinearLayout.LayoutParams lp = new LinearLayout.LayoutParams(
			LayoutParams.MATCH_PARENT, LayoutParams.WRAP_CONTENT);
	lp.weight = 1;
	vTop.setOnClickListener(new OnClickListener() {
		public void onClick(View v) {
			finish();
		}
	});
	llPage.addView(vTop, lp);

	llPanel = new LinearLayout(activity);
	llPanel.setOrientation(LinearLayout.VERTICAL);
	lp = new LinearLayout.LayoutParams(
			LayoutParams.MATCH_PARENT, LayoutParams.WRAP_CONTENT);
	llPanel.setAnimation(animShow);
	llPage.addView(llPanel, lp);

	MobViewPager mvp = new MobViewPager(activity);
	ArrayList<Object> cells = collectCells();
	PlatformPageAdapter adapter = newAdapter(cells);
	lp = new LinearLayout.LayoutParams(LayoutParams.MATCH_PARENT, adapter.getPanelHeight());
	llPanel.addView(mvp, lp);

	IndicatorView vInd = new IndicatorView(activity);
	lp = new LinearLayout.LayoutParams(LayoutParams.MATCH_PARENT, adapter.getBottomHeight());
	llPanel.addView(vInd, lp);

	vInd.setScreenCount(adapter.getCount());
	vInd.onScreenChange(0, 0);
	adapter.setIndicator(vInd);
	mvp.setAdapter(adapter);
}
 
Example 8
Source File: PlatformPage.java    From BaoKanAndroid with MIT License 4 votes vote down vote up
public void onCreate() {
	activity.getWindow().setBackgroundDrawable(new ColorDrawable(0x4c000000));
	initAnims();

	LinearLayout llPage = new LinearLayout(activity);
	llPage.setOrientation(LinearLayout.VERTICAL);
	activity.setContentView(llPage);

	TextView vTop = new TextView(activity);
	LinearLayout.LayoutParams lp = new LinearLayout.LayoutParams(
			LayoutParams.MATCH_PARENT, LayoutParams.WRAP_CONTENT);
	lp.weight = 1;
	vTop.setOnClickListener(new OnClickListener() {
		public void onClick(View v) {
			finish();
		}
	});
	llPage.addView(vTop, lp);

	llPanel = new LinearLayout(activity);
	llPanel.setOrientation(LinearLayout.VERTICAL);
	lp = new LinearLayout.LayoutParams(
			LayoutParams.MATCH_PARENT, LayoutParams.WRAP_CONTENT);
	llPanel.setAnimation(animShow);
	llPage.addView(llPanel, lp);

	MobViewPager mvp = new MobViewPager(activity);
	ArrayList<Object> cells = collectCells();
	PlatformPageAdapter adapter = newAdapter(cells);
	lp = new LinearLayout.LayoutParams(LayoutParams.MATCH_PARENT, adapter.getPanelHeight());
	llPanel.addView(mvp, lp);

	IndicatorView vInd = new IndicatorView(activity);
	lp = new LinearLayout.LayoutParams(LayoutParams.MATCH_PARENT, adapter.getBottomHeight());
	llPanel.addView(vInd, lp);

	vInd.setScreenCount(adapter.getCount());
	vInd.onScreenChange(0, 0);
	adapter.setIndicator(vInd);
	mvp.setAdapter(adapter);
}
 
Example 9
Source File: PlatformPage.java    From MyHearts with Apache License 2.0 4 votes vote down vote up
public void onCreate() {
	activity.getWindow().setBackgroundDrawable(new ColorDrawable(0x4c000000));
	initAnims();

	LinearLayout llPage = new LinearLayout(activity);
	llPage.setOrientation(LinearLayout.VERTICAL);
	activity.setContentView(llPage);

	TextView vTop = new TextView(activity);
	LinearLayout.LayoutParams lp = new LinearLayout.LayoutParams(
			LayoutParams.MATCH_PARENT, LayoutParams.WRAP_CONTENT);
	lp.weight = 1;
	vTop.setOnClickListener(new OnClickListener() {
		public void onClick(View v) {
			finish();
		}
	});
	llPage.addView(vTop, lp);

	llPanel = new LinearLayout(activity);
	llPanel.setOrientation(LinearLayout.VERTICAL);
	lp = new LinearLayout.LayoutParams(
			LayoutParams.MATCH_PARENT, LayoutParams.WRAP_CONTENT);
	llPanel.setAnimation(animShow);
	llPage.addView(llPanel, lp);

	MobViewPager mvp = new MobViewPager(activity);
	ArrayList<Object> cells = collectCells();
	PlatformPageAdapter adapter = newAdapter(cells);
	lp = new LinearLayout.LayoutParams(LayoutParams.MATCH_PARENT, adapter.getPanelHeight());
	llPanel.addView(mvp, lp);

	IndicatorView vInd = new IndicatorView(activity);
	lp = new LinearLayout.LayoutParams(LayoutParams.MATCH_PARENT, adapter.getBottomHeight());
	llPanel.addView(vInd, lp);

	vInd.setScreenCount(adapter.getCount());
	vInd.onScreenChange(0, 0);
	adapter.setIndicator(vInd);
	mvp.setAdapter(adapter);
}
 
Example 10
Source File: PlatformPage.java    From GithubApp with Apache License 2.0 4 votes vote down vote up
public void onCreate() {
	activity.getWindow().setBackgroundDrawable(new ColorDrawable(0x4c000000));
	initAnims();

	LinearLayout llPage = new LinearLayout(activity);
	llPage.setOrientation(LinearLayout.VERTICAL);
	activity.setContentView(llPage);

	TextView vTop = new TextView(activity);
	LinearLayout.LayoutParams lp = new LinearLayout.LayoutParams(
			LayoutParams.MATCH_PARENT, LayoutParams.WRAP_CONTENT);
	lp.weight = 1;
	vTop.setOnClickListener(new OnClickListener() {
		public void onClick(View v) {
			finish();
		}
	});
	llPage.addView(vTop, lp);

	llPanel = new LinearLayout(activity);
	llPanel.setOrientation(LinearLayout.VERTICAL);
	lp = new LinearLayout.LayoutParams(
			LayoutParams.MATCH_PARENT, LayoutParams.WRAP_CONTENT);
	llPanel.setAnimation(animShow);
	llPage.addView(llPanel, lp);

	MobViewPager mvp = new MobViewPager(activity);
	ArrayList<Object> cells = collectCells();
	PlatformPageAdapter adapter = newAdapter(cells);
	lp = new LinearLayout.LayoutParams(LayoutParams.MATCH_PARENT, adapter.getPanelHeight());
	llPanel.addView(mvp, lp);

	IndicatorView vInd = new IndicatorView(activity);
	lp = new LinearLayout.LayoutParams(LayoutParams.MATCH_PARENT, adapter.getBottomHeight());
	llPanel.addView(vInd, lp);

	vInd.setScreenCount(adapter.getCount());
	vInd.onScreenChange(0, 0);
	adapter.setIndicator(vInd);
	mvp.setAdapter(adapter);
}
 
Example 11
Source File: PlatformPage.java    From fingerpoetry-android with Apache License 2.0 4 votes vote down vote up
public void onCreate() {
	activity.getWindow().setBackgroundDrawable(new ColorDrawable(0x4c000000));
	initAnims();

	LinearLayout llPage = new LinearLayout(activity);
	llPage.setOrientation(LinearLayout.VERTICAL);
	activity.setContentView(llPage);

	TextView vTop = new TextView(activity);
	LinearLayout.LayoutParams lp = new LinearLayout.LayoutParams(
			LayoutParams.MATCH_PARENT, LayoutParams.WRAP_CONTENT);
	lp.weight = 1;
	vTop.setOnClickListener(new OnClickListener() {
		public void onClick(View v) {
			finish();
		}
	});
	llPage.addView(vTop, lp);

	llPanel = new LinearLayout(activity);
	llPanel.setOrientation(LinearLayout.VERTICAL);
	lp = new LinearLayout.LayoutParams(
			LayoutParams.MATCH_PARENT, LayoutParams.WRAP_CONTENT);
	llPanel.setAnimation(animShow);
	llPage.addView(llPanel, lp);

	MobViewPager mvp = new MobViewPager(activity);
	ArrayList<Object> cells = collectCells();
	PlatformPageAdapter adapter = newAdapter(cells);
	lp = new LinearLayout.LayoutParams(LayoutParams.MATCH_PARENT, adapter.getPanelHeight());
	llPanel.addView(mvp, lp);

	IndicatorView vInd = new IndicatorView(activity);
	lp = new LinearLayout.LayoutParams(LayoutParams.MATCH_PARENT, adapter.getBottomHeight());
	llPanel.addView(vInd, lp);

	vInd.setScreenCount(adapter.getCount());
	vInd.onScreenChange(0, 0);
	adapter.setIndicator(vInd);
	mvp.setAdapter(adapter);
}
 
Example 12
Source File: PlatformPage.java    From HHComicViewer with Apache License 2.0 4 votes vote down vote up
public void onCreate() {
	activity.getWindow().setBackgroundDrawable(new ColorDrawable(0x4c000000));
	initAnims();

	LinearLayout llPage = new LinearLayout(activity);
	llPage.setOrientation(LinearLayout.VERTICAL);
	activity.setContentView(llPage);

	TextView vTop = new TextView(activity);
	LinearLayout.LayoutParams lp = new LinearLayout.LayoutParams(
			LayoutParams.MATCH_PARENT, LayoutParams.WRAP_CONTENT);
	lp.weight = 1;
	vTop.setOnClickListener(new OnClickListener() {
		public void onClick(View v) {
			finish();
		}
	});
	llPage.addView(vTop, lp);

	llPanel = new LinearLayout(activity);
	llPanel.setOrientation(LinearLayout.VERTICAL);
	lp = new LinearLayout.LayoutParams(
			LayoutParams.MATCH_PARENT, LayoutParams.WRAP_CONTENT);
	llPanel.setAnimation(animShow);
	llPage.addView(llPanel, lp);

	MobViewPager mvp = new MobViewPager(activity);
	ArrayList<Object> cells = collectCells();
	PlatformPageAdapter adapter = newAdapter(cells);
	lp = new LinearLayout.LayoutParams(LayoutParams.MATCH_PARENT, adapter.getPanelHeight());
	llPanel.addView(mvp, lp);

	IndicatorView vInd = new IndicatorView(activity);
	lp = new LinearLayout.LayoutParams(LayoutParams.MATCH_PARENT, adapter.getBottomHeight());
	llPanel.addView(vInd, lp);

	vInd.setScreenCount(adapter.getCount());
	vInd.onScreenChange(0, 0);
	adapter.setIndicator(vInd);
	mvp.setAdapter(adapter);
}