-
Notifications
You must be signed in to change notification settings - Fork 13
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
125 additions
and
31 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
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,28 @@ | ||
package xyz.gianlu.librespot.android; | ||
|
||
import android.content.Context; | ||
import android.widget.EditText; | ||
|
||
import com.google.android.material.textfield.TextInputLayout; | ||
|
||
import org.jetbrains.annotations.NotNull; | ||
|
||
import java.io.File; | ||
|
||
public final class Utils { | ||
|
||
private Utils() { | ||
} | ||
|
||
@NotNull | ||
public static String getText(@NotNull TextInputLayout layout) { | ||
EditText editText = layout.getEditText(); | ||
if (editText == null) throw new IllegalStateException(); | ||
return editText.getText().toString(); | ||
} | ||
|
||
@NotNull | ||
public static File getCredentialsFile(@NotNull Context context) { | ||
return new File(context.getDataDir(), "credentials.json"); | ||
} | ||
} |
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