Skip to content

Instantly share code, notes, and snippets.

Avatar
🎯
Focusing

Mostafa Anter MostafaAnter

🎯
Focusing
View GitHub Profile
@MostafaAnter
MostafaAnter / SharedPrefs.kt
Created Aug 16, 2020 — forked from RahulSDeshpande/SharedPrefs.kt
'SharedPrefs' utility class written Kotlin, for storing and retrieving data from SharedPreference in Android.
View SharedPrefs.kt
import android.content.Context
import android.preference.PreferenceManager
import android.util.Log
import java.lang.ref.WeakReference
/**
* Created by rahuldeshpande on 02/06/19.
*/
object SharedPrefs {
View response travel
08-19 14:44:18.689 7363-8156/travel.com D/OkHttp: <-- 200 OK http://php-eg.com/travel/public/api/register (8267ms)
Server: nginx
Date: Sun, 19 Aug 2018 12:44:18 GMT
08-19 14:44:18.690 7363-8156/travel.com D/OkHttp: Content-Type: application/json
Transfer-Encoding: chunked
Connection: keep-alive
Vary: Accept-Encoding
X-Powered-By: PHP/7.1.20
Cache-Control: no-cache, private
08-19 14:44:18.691 7363-8156/travel.com D/OkHttp: X-RateLimit-Limit: 60
View request data
08-19 14:44:10.288 7363-7363/travel.com D/nama file e cuk: received_2255852471305536.jpeg
08-19 14:44:10.403 7363-8156/travel.com D/OkHttp: --> POST http://php-eg.com/travel/public/api/register
Content-Type: multipart/form-data; boundary=d21b4a15-ea7c-433d-a37f-10a230c0d2ea
08-19 14:44:10.407 7363-8156/travel.com D/OkHttp: Content-Length: 18842
Accept: application/json
Authorization: empty
From: 1111
Accept-Language: ar
User-Agent: android
08-19 14:44:10.412 7363-8156/travel.com D/OkHttp: --d21b4a15-ea7c-433d-a37f-10a230c0d2ea
@MostafaAnter
MostafaAnter / README.md
Created Jun 16, 2017 — forked from gabrielemariotti/README.md
A SectionedGridRecyclerViewAdapter: use this class to realize a simple sectioned grid `RecyclerView.Adapter`.
View README.md

You can use this class to realize a simple sectioned grid RecyclerView.Adapter without changing your code.

Screen

The RecyclerView has to use a GridLayoutManager.

This is a porting of the class SimpleSectionedListAdapter provided by Google

If you are looking for a sectioned list RecyclerView.Adapter you can take a look here

@MostafaAnter
MostafaAnter / SempleSectioned.md
Last active May 29, 2017 — forked from gabrielemariotti/Readme.md
A SimpleSectionedRecyclerViewAdapter: use this class to realize a simple sectioned `RecyclerView.Adapter`.
View SempleSectioned.md

You can use this class to realize a simple sectioned RecyclerView.Adapter without changing your code.

The RecyclerView should use a LinearLayoutManager. You can use this code also with the TwoWayView with the ListLayoutManager (https://github.com/lucasr/twoway-view)

This is a porting of the class SimpleSectionedListAdapter provided by Google

Screen

Example:

@MostafaAnter
MostafaAnter / Groups.java
Created Aug 27, 2016
استركشر ال objects
View Groups.java
package perfect_apps.makonway.models;
import io.realm.RealmObject;
import io.realm.annotations.RealmClass;
/**
* Created by mostafa on 30/04/16.
*/
@MostafaAnter
MostafaAnter / ChatsAdapter.java
Created Aug 27, 2016
دى الخطوه الاخير اسم المحادثه واخر رساله والوقت
View ChatsAdapter.java
// set group name
if (mDataSet.get(position).isGroup()) {
viewHolder.getUser_name().setText(mDataSet.get(position).getName());
} else {
final String encodedEmail = Utils.cutMailFromText(mContext, mDataSet.get(position).getName());
final DatabaseReference userLocation = FirebaseDatabase.getInstance()
.getReferenceFromUrl(Constants.FIREBASE_URL_USERS)
.child(encodedEmail);
userLocation.addListenerForSingleValueEvent(new ValueEventListener() {
@Override
@MostafaAnter
MostafaAnter / ChatMyChatsTab.java
Created Aug 27, 2016
دى اول خطوه هتجيب كل الجروب بتاعة المستخدم
View ChatMyChatsTab.java
rivate void fetchUserGroupsAndPutItIntoRecyclerView() {
// delete dataSet if Online
if (mDataset.size() > 0) {
clearDataSet();
}
final String encodedEmail = Utils.encodeEmail(new MAKPrefStore(getActivity()).getPreferenceValue(Constants.PREFERENCE_USER_EMAIL));
final DatabaseReference mainLocation = FirebaseDatabase.getInstance()
.getReferenceFromUrl(Constants.FIREBASE_URL);
View UploadFile.java
/**
* Uploading the file to server
* Created by Mostafa Anter on 13/05/16.
* */
private class UploadFileToServer extends AsyncTask<Void, Integer, String> {
private DonutProgress donutProgress;
private String filePath;
public UploadFileToServer(DonutProgress donutProgress, String filePath) {
this.donutProgress = donutProgress;
@MostafaAnter
MostafaAnter / AppHelper.java
Created Jun 7, 2016 — forked from anggadarkprince/AppHelper.java
Upload file with Multipart Request Volley Android
View AppHelper.java
import android.graphics.Bitmap;
import android.graphics.drawable.BitmapDrawable;
import android.graphics.drawable.Drawable;
import java.io.ByteArrayOutputStream;
/**
* Sketch Project Studio
* Created by Angga on 12/04/2016 14.27.
*/
public class AppHelper {
You can’t perform that action at this time.