Skip to content

Commit

Permalink
Counter_v1.5.5
Browse files Browse the repository at this point in the history
  • Loading branch information
LaIixia committed Oct 1, 2024
1 parent 859f081 commit 1621233
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 14 deletions.
1 change: 1 addition & 0 deletions .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ android {
minSdk 21
targetSdk 34
versionCode 1
versionName "1.5"
versionName "1.5.5"

testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
Expand Down
12 changes: 10 additions & 2 deletions app/src/main/java/com/myapp/textcounter/Buttons.java
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,18 @@ public class Buttons {
//edittextの改行抜きでテキストの文字数を取得するメソッド
public String BreakCnt(String letters,String lines) {return format((Integer.parseInt(letters) - Integer.parseInt(lines))+1);}
//空白抜きでテキストの文字数をカウント
public String EmptyCnt(String letters) {return format(letters.replaceAll(" ", "").length());}
public String EmptyCnt(String letters) {
//全角が含まれる場合半角に置き換え、その置き換えた半角を””に置き換えて、その際のdataの長さを返す
if(letters.contains(" ")){
String data = letters.replaceAll(" ", " ");//全角=>半角
return format(data.replaceAll(" ","").length());//半角=>空
}
//全角が含まれない場合
return format(letters.replaceAll(" ","").length());
}

//Intをstring型に変換するメソッド
public String format(int lines) {return String.valueOf (lines);}

//edittextの文字列の長さが0であるか判断するメソッド
public boolean Judge(Editable l) {return Integer.parseInt (Count (l)) == 0;}//0の場合だけtrueを返す
//OS Version Check
Expand Down
11 changes: 0 additions & 11 deletions app/src/main/java/com/myapp/textcounter/SubActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -27,17 +27,6 @@ protected void onCreate(Bundle savedInstanceState) {
String text = b.getString("text data"),
lines = b.getString ("text lines");

/* TextView LT = findViewById (R.id.text_letters2),
LI = findViewById (R.id.text_lines2),
PA = findViewById (R.id.text_paper2),
EM = findViewById (R.id.text_empty2),
BR = findViewById (R.id.text_break2),
UTF8 = findViewById (R.id.text_utf_8_2),
UTF16 = findViewById (R.id.text_utf_16_2),
EUC = findViewById (R.id.text_euc_2),
SHIFT = findViewById (R.id.text_shift_2),
JIS = findViewById (R.id.text_jis_2);*/

LT = findViewById (R.id.text_letters2);
LI = findViewById (R.id.text_lines2);
//PA = findViewById (R.id.text_paper2);
Expand Down

0 comments on commit 1621233

Please sign in to comment.