-
Notifications
You must be signed in to change notification settings - Fork 0
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
Showing
5 changed files
with
80 additions
and
74 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,31 @@ | ||
package com.myapp.textcounter; | ||
|
||
import android.text.Editable; | ||
import android.widget.EditText; | ||
import androidx.appcompat.app.AppCompatActivity; | ||
|
||
public class Buttons { | ||
public class Buttons extends AppCompatActivity { | ||
//テキストのカウント | ||
private int textLen; | ||
|
||
//edittextの文字列の長さを取得するメソッド | ||
public void setCount(Editable text){this.textLen = text.length();} | ||
//edittextの文字列の長さを返すメソッド | ||
public int getCount(){ return this.textLen; } | ||
|
||
public boolean setJudge(int len){ | ||
if(len == 0){ | ||
return true; | ||
} | ||
else { | ||
return false; | ||
} | ||
//edittextの文字列の長さが0であるか判断するメソッド | ||
public boolean setJudge(){ | ||
if(textLen == 0){return true;} | ||
else {return false;} | ||
} | ||
//Int型からstring型に変換するメソッド | ||
//textLenの値から変換 | ||
public String format(){return Integer.toString (textLen);} | ||
//引数から変換 | ||
public String formatter(int lines){ | ||
return Integer.toString (lines); | ||
} | ||
|
||
|
||
|
||
} |
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