Skip to content

Instantly share code, notes, and snippets.

View Raf0707's full-sized avatar
🏠
Working from home

Rafail Raf0707

🏠
Working from home
View GitHub Profile
@Raf0707
Raf0707 / AppAboutFragment.kt
Created November 17, 2024 22:22
AppAboutFragment.kt
package ibn.rustum.arabistic.ui.about_app
import android.annotation.SuppressLint
import android.content.ActivityNotFoundException
import android.content.ClipData
import android.content.ClipboardManager
import android.content.Context
import android.content.Intent
import android.content.SharedPreferences
import android.net.Uri
@Raf0707
Raf0707 / strings.xml
Created November 17, 2024 22:21
strings.xml
<string name="version">Версия: 1.0.0.0</string>
<string name="rafail_url" translatable="false">https://github.com/Raf0707</string>
<string name="mail_raf" translatable="false">[email protected]</string>
<string name="source_code">Исходный код</string>
<string name="source_code_url" translatable="false">https://github.com/Raf0707/IbnRustumArabistic</string>
<string name="from_tabiin">from Tabiin</string>
<string name="tabiin" translatable="false">https://vk.com/tabiin_muslim_planner</string>
<string name="Raf_title">Рафаил Кикматулин</string>
<string name="raf_android_dev_mail_ru">[email protected]</string>
<string name="version_copied">version copied</string>
@Raf0707
Raf0707 / app_about_fragment.xml
Created November 17, 2024 22:12
app_about_fragment.xml
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout
android:id="@+id/appAboutFragment"
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:openDrawer="start"
tools:context=".ui.app_about.AppAboutFragment">
private void goToPageAlert() {
MaterialAlertDialogBuilder alert = new MaterialAlertDialogBuilder(this);
View dialogView = getLayoutInflater().inflate(R.layout.go_to_page_dialog, null);
alert.setTitle("Перейти на страницу");
alert.setMessage("Введите страницу");
alert.setCancelable(true);
public int goToAyat(int numSure, int numAyat) {
int numPage = 1;
switch (numSure) {
case 1:
if (numAyat >= 1 && numAyat <= 7) numPage = 1;
else return -1;
break;
case 2:
if (numAyat >= 1 && numAyat <= 5) numPage = 2;
else if (numAyat >= 6 && numAyat <= 16) numPage = 3;
@Raf0707
Raf0707 / SuresAyatsPages.java
Created July 16, 2024 23:33
SuresAyatsPages
public String getAyatsOnPage(int page) {
switch (page) {
//Сура 1 Аль-Фатиха - Открывающая
case 1: return " аяты: 1-7";
//Сура 2 Аль-Бакара - Корова
case 2: return " аяты: 1-5";
case 3: return " аяты: 6-16";
case 4: return " аяты: 17-24";
case 5: return " аяты: 25-29";
@Raf0707
Raf0707 / Food
Created May 22, 2024 00:23
Food
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/main"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".ui.main.vocabulary.FoodActivity">
<TableLayout
@Raf0707
Raf0707 / StandartMediaPlayer
Created May 13, 2024 14:25
StandartMediaPlayer
import android.media.MediaPlayer;
public class StandartMediaPlayer {
private MediaPlayer mediaPlayer;
private int currentPosition;
static MediaPlayer instance;
public StandartMediaPlayer() {
mediaPlayer = new MediaPlayer();
@Raf0707
Raf0707 / MyMediaPlayer
Created May 13, 2024 14:25
MyMediaPlayer
import android.content.Context;
import android.content.res.AssetFileDescriptor;
import android.media.AudioManager;
import android.media.MediaPlayer;
import android.widget.ImageButton;
import android.widget.SeekBar;
import androidx.recyclerview.widget.RecyclerView;
import java.io.IOException;
private String getSuraTitle(int page) {
switch (page) {
case 1:
return "Сура 1. Аль-Фатиха - Открывающая";
case 2: case 3: case 4: case 5: case 6:
case 7: case 8: case 9: case 10: case 11:
case 12: case 13: case 14: case 15: case 16:
case 17: case 18: case 19: case 20: case 21:
case 22: case 23: case 24: case 25: case 26:
case 27: case 28: case 29: case 30: case 31: