-
Notifications
You must be signed in to change notification settings - Fork 591
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
xiaoyao
committed
Jul 4, 2017
1 parent
5fd8adb
commit 6534810
Showing
28 changed files
with
1,931 additions
and
1,357 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
88 changes: 88 additions & 0 deletions
88
app/src/main/java/com/allen/supertextview/ClickActivity.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,88 @@ | ||
package com.allen.supertextview; | ||
|
||
import android.support.v7.app.AppCompatActivity; | ||
import android.os.Bundle; | ||
import android.widget.Toast; | ||
|
||
import com.allen.library.SuperTextView; | ||
|
||
public class ClickActivity extends AppCompatActivity { | ||
|
||
private SuperTextView superTextView; | ||
|
||
private String string; | ||
|
||
@Override | ||
protected void onCreate(Bundle savedInstanceState) { | ||
super.onCreate(savedInstanceState); | ||
setContentView(R.layout.activity_click); | ||
|
||
superTextView = (SuperTextView) findViewById(R.id.super_tv); | ||
|
||
/** | ||
* 根据实际需求对需要的View设置点击事件 | ||
*/ | ||
superTextView.setOnSuperTextViewClickListener(new SuperTextView.OnSuperTextViewClickListener() { | ||
@Override | ||
public void onClickListener() { | ||
string = "整个item的点击事件"; | ||
Toast.makeText(ClickActivity.this, string, Toast.LENGTH_SHORT).show(); | ||
} | ||
}).setLeftTopTvClickListener(new SuperTextView.OnLeftTopTvClickListener() { | ||
@Override | ||
public void onClickListener() { | ||
string = superTextView.getLeftTopString(); | ||
Toast.makeText(ClickActivity.this, string, Toast.LENGTH_SHORT).show(); | ||
} | ||
}).setLeftTvClickListener(new SuperTextView.OnLeftTvClickListener() { | ||
@Override | ||
public void onClickListener() { | ||
string = superTextView.getLeftString(); | ||
Toast.makeText(ClickActivity.this, string, Toast.LENGTH_SHORT).show(); | ||
} | ||
}).setLeftBottomTvClickListener(new SuperTextView.OnLeftBottomTvClickListener() { | ||
@Override | ||
public void onClickListener() { | ||
string = superTextView.getLeftBottomString(); | ||
Toast.makeText(ClickActivity.this, string, Toast.LENGTH_SHORT).show(); | ||
} | ||
}).setCenterTopTvClickListener(new SuperTextView.OnCenterTopTvClickListener() { | ||
@Override | ||
public void onClickListener() { | ||
string = superTextView.getCenterTopString(); | ||
Toast.makeText(ClickActivity.this, string, Toast.LENGTH_SHORT).show(); | ||
} | ||
}).setCenterTvClickListener(new SuperTextView.OnCenterTvClickListener() { | ||
@Override | ||
public void onClickListener() { | ||
string = superTextView.getCenterString(); | ||
Toast.makeText(ClickActivity.this, string, Toast.LENGTH_SHORT).show(); | ||
} | ||
}).setCenterBottomTvClickListener(new SuperTextView.OnCenterBottomTvClickListener() { | ||
@Override | ||
public void onClickListener() { | ||
string = superTextView.getCenterBottomString(); | ||
Toast.makeText(ClickActivity.this, string, Toast.LENGTH_SHORT).show(); | ||
} | ||
}).setRightTopTvClickListener(new SuperTextView.OnRightTopTvClickListener() { | ||
@Override | ||
public void onClickListener() { | ||
string = superTextView.getRightTopString(); | ||
Toast.makeText(ClickActivity.this, string, Toast.LENGTH_SHORT).show(); | ||
} | ||
}).setRightTvClickListener(new SuperTextView.OnRightTvClickListener() { | ||
@Override | ||
public void onClickListener() { | ||
string = superTextView.getRightString(); | ||
Toast.makeText(ClickActivity.this, string, Toast.LENGTH_SHORT).show(); | ||
} | ||
}).setRightBottomTvClickListener(new SuperTextView.OnRightBottomTvClickListener() { | ||
@Override | ||
public void onClickListener() { | ||
string = superTextView.getRightBottomString(); | ||
Toast.makeText(ClickActivity.this, string, Toast.LENGTH_SHORT).show(); | ||
} | ||
}); | ||
|
||
} | ||
} |
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
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
Oops, something went wrong.