-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
ddae94d
commit fa201d5
Showing
33 changed files
with
828 additions
and
171 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
77 changes: 0 additions & 77 deletions
77
app/src/main/java/com/lky/toucheffectsviewdemo/TouchEffectsMainActivity.java
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
98 changes: 98 additions & 0 deletions
98
app/src/main/java/com/lky/toucheffectsviewdemo/activity/TouchEffectsMainActivity.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,98 @@ | ||
package com.lky.toucheffectsviewdemo.activity; | ||
|
||
import android.content.Intent; | ||
import android.os.Bundle; | ||
import android.support.v7.widget.LinearLayoutManager; | ||
import android.support.v7.widget.RecyclerView; | ||
import android.view.LayoutInflater; | ||
import android.view.Menu; | ||
import android.view.MenuItem; | ||
import android.view.View; | ||
import android.view.ViewGroup; | ||
import android.widget.TextView; | ||
|
||
import com.lky.toucheffectsmodule.TouchEffectsManager; | ||
import com.lky.toucheffectsmodule.types.TouchEffectsViewType; | ||
import com.lky.toucheffectsmodule.types.TouchEffectsWholeType; | ||
import com.lky.toucheffectsviewdemo.R; | ||
import com.lky.toucheffectsviewdemo.bean.JumpBean; | ||
|
||
import java.util.ArrayList; | ||
|
||
public class TouchEffectsMainActivity extends TouchEffectsBaseActivity implements View.OnClickListener{ | ||
|
||
@Override | ||
protected void onCreate(Bundle savedInstanceState) { | ||
super.onCreate(savedInstanceState); | ||
setContentView(R.layout.touch_effects_activity_main); | ||
|
||
ArrayList<JumpBean> jumpArrayList = new ArrayList<>(); | ||
jumpArrayList.add(new JumpBean("缩放效果示例",TouchEffectsScaleActivity.class)); | ||
jumpArrayList.add(new JumpBean("水波纹效果示例",TouchEffectsRippleActivity.class)); | ||
jumpArrayList.add(new JumpBean("水波纹1效果示例",TouchEffectsRipple1Activity.class)); | ||
jumpArrayList.add(new JumpBean("渐变效果示例",TouchEffectsStateActivity.class)); | ||
jumpArrayList.add(new JumpBean("抖动效果示例",TouchEffectsShakeActivity.class)); | ||
jumpArrayList.add(new JumpBean("列表效果示例",TouchEffectsListActivity.class)); | ||
jumpArrayList.add(new JumpBean("个性化设置示例",TouchEffectsPersonalizedSettingsActivity.class)); | ||
|
||
RecyclerView recyclerView = findViewById(R.id.touch_effects_main_recycler); | ||
recyclerView.setLayoutManager(new LinearLayoutManager(this,LinearLayoutManager.VERTICAL,false)); | ||
RecyclerAdapter adapter = new RecyclerAdapter(jumpArrayList); | ||
recyclerView.setAdapter(adapter); | ||
|
||
|
||
} | ||
|
||
class RecyclerAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder>{ | ||
|
||
private ArrayList<JumpBean> mJumpArrayList; | ||
|
||
|
||
public RecyclerAdapter(ArrayList<JumpBean> jumpArrayList) { | ||
mJumpArrayList = jumpArrayList; | ||
} | ||
|
||
@Override | ||
public RecyclerView.ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) { | ||
return new ViewHolder(LayoutInflater.from(parent.getContext()).inflate(R.layout.touch_effects_layout_list_item,parent,false)); | ||
} | ||
|
||
@Override | ||
public void onBindViewHolder(RecyclerView.ViewHolder holder, int position) { | ||
bindHolder((ViewHolder)holder,position); | ||
} | ||
|
||
private void bindHolder(ViewHolder holder, int position) { | ||
((TextView)holder.itemView).setText(mJumpArrayList.get(position).getTitleName()); | ||
holder.itemView.setOnClickListener(new View.OnClickListener() { | ||
@Override | ||
public void onClick(View v) { | ||
startActivity(new Intent(TouchEffectsMainActivity.this,mJumpArrayList.get(position).getJumpClass())); | ||
} | ||
}); | ||
} | ||
|
||
@Override | ||
public int getItemCount() { | ||
return mJumpArrayList.size(); | ||
} | ||
|
||
class ViewHolder extends RecyclerView.ViewHolder{ | ||
public ViewHolder(View itemView) { | ||
super(itemView); | ||
} | ||
} | ||
|
||
} | ||
|
||
@Override | ||
public void onClick(View v) { | ||
|
||
} | ||
|
||
@Override | ||
public boolean onCreateOptionsMenu(Menu menu) { | ||
return true; | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
38 changes: 38 additions & 0 deletions
38
app/src/main/java/com/lky/toucheffectsviewdemo/activity/TouchEffectsRipple1Activity.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
package com.lky.toucheffectsviewdemo.activity; | ||
|
||
import android.os.Bundle; | ||
import android.support.annotation.Nullable; | ||
import android.view.View; | ||
|
||
import com.lky.toucheffectsmodule.factory.TouchEffectsFactory; | ||
import com.lky.toucheffectsmodule.types.TouchEffectsWholeType; | ||
import com.lky.toucheffectsviewdemo.R; | ||
|
||
public class TouchEffectsRipple1Activity extends TouchEffectsBaseActivity implements View.OnClickListener{ | ||
|
||
@Override | ||
protected void onCreate(@Nullable Bundle savedInstanceState) { | ||
super.onCreate(savedInstanceState); | ||
setContentView(R.layout.activity_touch_effects_sample); | ||
|
||
findViewById(R.id.touch_effects_sample_txt).setOnClickListener(this); | ||
findViewById(R.id.touch_effects_sample_btn).setOnClickListener(this); | ||
findViewById(R.id.touch_effects_sample_img).setOnClickListener(this); | ||
findViewById(R.id.touch_effects_sample_ib).setOnClickListener(this); | ||
findViewById(R.id.touch_effects_sample_fl).setOnClickListener(this); | ||
findViewById(R.id.touch_effects_sample_ll).setOnClickListener(this); | ||
findViewById(R.id.touch_effects_sample_rl).setOnClickListener(this); | ||
findViewById(R.id.touch_effects_sample_cl).setOnClickListener(this); | ||
} | ||
|
||
@Override | ||
protected void initTouchEffects() { | ||
TouchEffectsFactory.initTouchEffects(this,TouchEffectsWholeType.RIPPLE_1); | ||
} | ||
|
||
@Override | ||
public void onClick(View v) { | ||
|
||
} | ||
|
||
} |
39 changes: 39 additions & 0 deletions
39
app/src/main/java/com/lky/toucheffectsviewdemo/activity/TouchEffectsRippleActivity.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
package com.lky.toucheffectsviewdemo.activity; | ||
|
||
import android.os.Bundle; | ||
import android.support.annotation.Nullable; | ||
import android.view.View; | ||
|
||
import com.lky.toucheffectsmodule.factory.TouchEffectsFactory; | ||
import com.lky.toucheffectsmodule.types.TouchEffectsWholeType; | ||
import com.lky.toucheffectsviewdemo.R; | ||
|
||
public class TouchEffectsRippleActivity extends TouchEffectsBaseActivity implements View.OnClickListener{ | ||
|
||
@Override | ||
protected void onCreate(@Nullable Bundle savedInstanceState) { | ||
super.onCreate(savedInstanceState); | ||
setContentView(R.layout.activity_touch_effects_sample); | ||
|
||
findViewById(R.id.touch_effects_sample_txt).setOnClickListener(this); | ||
findViewById(R.id.touch_effects_sample_btn).setOnClickListener(this); | ||
findViewById(R.id.touch_effects_sample_img).setOnClickListener(this); | ||
findViewById(R.id.touch_effects_sample_ib).setOnClickListener(this); | ||
findViewById(R.id.touch_effects_sample_fl).setOnClickListener(this); | ||
findViewById(R.id.touch_effects_sample_ll).setOnClickListener(this); | ||
findViewById(R.id.touch_effects_sample_rl).setOnClickListener(this); | ||
findViewById(R.id.touch_effects_sample_cl).setOnClickListener(this); | ||
|
||
} | ||
|
||
@Override | ||
protected void initTouchEffects() { | ||
TouchEffectsFactory.initTouchEffects(this,TouchEffectsWholeType.RIPPLE); | ||
} | ||
|
||
@Override | ||
public void onClick(View v) { | ||
|
||
} | ||
|
||
} |
Oops, something went wrong.