-
Notifications
You must be signed in to change notification settings - Fork 69
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #89 from p-davide/master
Fixed #88 and removed unnecessary preference
- Loading branch information
Showing
8 changed files
with
173 additions
and
201 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
package io.github.subhamtyagi.ocr; | ||
|
||
import android.content.Context; | ||
|
||
import androidx.annotation.NonNull; | ||
|
||
public class Language { | ||
public String getCode() { | ||
return code; | ||
} | ||
|
||
public String getName() { | ||
return name; | ||
} | ||
|
||
private String code, name; | ||
public Language(@NonNull Context c, @NonNull String seed) { | ||
String[] languagesNames = c.getResources().getStringArray(R.array.ocr_engine_language); | ||
String[] languagesCodes = c.getResources().getStringArray(R.array.key_ocr_engine_language_value); | ||
for (int i = 0; i < languagesCodes.length; i++) { | ||
if (languagesCodes[i].equals(seed) || languagesNames[i].equals(seed)) { | ||
this.code = languagesCodes[i]; | ||
this.name = languagesNames[i]; | ||
} | ||
} | ||
} | ||
|
||
@NonNull | ||
@Override public String toString() { | ||
return getCode(); | ||
} | ||
} |
191 changes: 85 additions & 106 deletions
191
app/src/main/java/io/github/subhamtyagi/ocr/MainActivity.java
Large diffs are not rendered by default.
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
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
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