Infinite 3 rokov pred
rodič
commit
5e032109eb

+ 1 - 1
.idea/compiler.xml

@@ -1,6 +1,6 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <project version="4">
   <component name="CompilerConfiguration">
-    <bytecodeTargetLevel target="1.8" />
+    <bytecodeTargetLevel target="11" />
   </component>
 </project>

+ 1 - 1
.idea/misc.xml

@@ -43,7 +43,7 @@
       </value>
     </option>
   </component>
-  <component name="ProjectRootManager" version="2" languageLevel="JDK_1_8" default="true" project-jdk-name="1.8 (2)" project-jdk-type="JavaSDK">
+  <component name="ProjectRootManager" version="2" languageLevel="JDK_11" default="false" project-jdk-name="1.8 (2)" project-jdk-type="JavaSDK">
     <output url="file://$PROJECT_DIR$/build/classes" />
   </component>
   <component name="ProjectType">

+ 10 - 0
.idea/runConfigurations.xml

@@ -0,0 +1,10 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project version="4">
+  <component name="RunConfigurationProducerService">
+    <option name="ignoredProducers">
+      <set>
+        <option value="com.android.tools.idea.compose.preview.runconfiguration.ComposePreviewRunConfigurationProducer" />
+      </set>
+    </option>
+  </component>
+</project>

+ 3 - 10
app/src/main/java/club/thepenguins/android/activities/MainActivity.java

@@ -95,7 +95,6 @@ public class MainActivity extends AppCompatActivity {
 
         FCM();
 
-
         FragmentManager fragmentManager = getSupportFragmentManager();
 
         fragmentManager.beginTransaction().replace(R.id.flContent, HomeFragment.newInstance("null", "null")).commit();
@@ -154,17 +153,11 @@ public class MainActivity extends AppCompatActivity {
 
         navigationView.setNavigationItemSelectedListener(
 
-                new NavigationView.OnNavigationItemSelectedListener() {
-
-                    @Override
-
-                    public boolean onNavigationItemSelected(MenuItem menuItem) {
-
-                        selectDrawerItem(menuItem);
+                menuItem -> {
 
-                        return true;
+                    selectDrawerItem(menuItem);
 
-                    }
+                    return true;
 
                 });
 

+ 11 - 21
app/src/main/java/club/thepenguins/android/activities/PostActivity.java

@@ -55,6 +55,7 @@ public class PostActivity extends AppCompatActivity {
     private ShimmerFrameLayout loader;
     private ImageView imageView, share;
     private String title, author, image, link, content;
+    private View view;
 
 
     @Override
@@ -65,13 +66,7 @@ public class PostActivity extends AppCompatActivity {
         imageView = findViewById(R.id.back);
         share = findViewById(R.id.share);
 
-        imageView.setOnClickListener(new View.OnClickListener() {
-            @Override
-            public void onClick(View v) {
-
-                PostActivity.super.onBackPressed();
-            }
-        });
+        imageView.setOnClickListener(v -> PostActivity.super.onBackPressed());
 
         content = getIntent().getStringExtra("content");
         title = getIntent().getStringExtra("title");
@@ -79,6 +74,8 @@ public class PostActivity extends AppCompatActivity {
         image = getIntent().getStringExtra("image");
         link = getIntent().getStringExtra("link");
 
+        view = findViewById(R.id.line);
+
         loader = findViewById(R.id.shimmer_view_container);
 
         postData = new ArrayList<>();
@@ -98,23 +95,15 @@ public class PostActivity extends AppCompatActivity {
         recyclerView.setLayoutManager(layoutManager);
 
 
-        handler.postDelayed(new Runnable() {
-            @Override
-            public void run() {
-                commentAdapter = new CommentAdapter(comments, PostActivity.this);
-                recyclerView.setAdapter(commentAdapter);
-                String intValue = content.replaceAll("[^0-9]", "").substring(1);
+        handler.postDelayed(() -> {
+            commentAdapter = new CommentAdapter(comments, PostActivity.this);
+            recyclerView.setAdapter(commentAdapter);
+            String intValue = content.replaceAll("[^0-9]", "").substring(1);
 
-                getComments(intValue);
-            }
+            getComments(intValue);
         }, 3000);
 
-        share.setOnClickListener(new View.OnClickListener() {
-            @Override
-            public void onClick(View v) {
-                sharePost(PostActivity.this, link);
-            }
-        });
+        share.setOnClickListener(v -> sharePost(PostActivity.this, link));
 
 
     }
@@ -192,6 +181,7 @@ public class PostActivity extends AppCompatActivity {
                             WebSettingsCompat.setForceDark(myWebView.getSettings(), WebSettingsCompat.FORCE_DARK_ON);
                         }
                     }
+
                     loader.setVisibility(View.GONE);
                     textView.setVisibility(View.VISIBLE);
                     recyclerView.setVisibility(View.VISIBLE);

+ 3 - 5
app/src/main/java/club/thepenguins/android/activities/SplashActivity.java

@@ -16,11 +16,9 @@ public class SplashActivity extends AppCompatActivity {
         setContentView(R.layout.activity_splash);
 
         int secondsDelayed = 1;
-        new Handler().postDelayed(new Runnable() {
-            public void run() {
-                startActivity(new Intent(SplashActivity.this, MainActivity.class));
-                finish();
-            }
+        new Handler().postDelayed(() -> {
+            startActivity(new Intent(SplashActivity.this, MainActivity.class));
+            finish();
         }, secondsDelayed * 1000);
     }
 }

+ 10 - 13
app/src/main/java/club/thepenguins/android/adapters/PostRecyclerAdapter.java

@@ -76,19 +76,16 @@ public class PostRecyclerAdapter extends RecyclerView.Adapter<PostRecyclerAdapte
                 });
 
 
-        holder.cardView.setOnClickListener(new View.OnClickListener() {
-            @Override
-            public void onClick(View v) {
-
-                Intent intent = new Intent(ctx, PostActivity.class);
-                intent.putExtra("content", object.Content);
-                intent.putExtra("author", object.author);
-                intent.putExtra("image", object.Image);
-                intent.putExtra("title", object.title);
-                intent.putExtra("link", object.link);
-                ctx.startActivity(intent);
-
-            }
+        holder.cardView.setOnClickListener(v -> {
+
+            Intent intent = new Intent(ctx, PostActivity.class);
+            intent.putExtra("content", object.Content);
+            intent.putExtra("author", object.author);
+            intent.putExtra("image", object.Image);
+            intent.putExtra("title", object.title);
+            intent.putExtra("link", object.link);
+            ctx.startActivity(intent);
+
         });
 
 

+ 1 - 6
app/src/main/java/club/thepenguins/android/adapters/ThanksAdapter.java

@@ -45,12 +45,7 @@ public class ThanksAdapter extends RecyclerView.Adapter<ThanksAdapter.ViewHolder
         final String object = data.get(position);
 
         holder.name.setText(object);
-        holder.name.setOnClickListener(new View.OnClickListener() {
-            @Override
-            public void onClick(View v) {
-                Toasty.success(ctx, object, Toast.LENGTH_SHORT, false).show();
-            }
-        });
+        holder.name.setOnClickListener(v -> Toasty.success(ctx, object, Toast.LENGTH_SHORT, false).show());
 
     }
 

+ 9 - 34
app/src/main/java/club/thepenguins/android/fragments/AboutFragment.java

@@ -75,40 +75,15 @@ public class AboutFragment extends Fragment {
         imageView = rootView.findViewById(R.id.git);
 
 
-        textView1.setOnClickListener(new View.OnClickListener() {
-            @Override
-            public void onClick(View v) {
-                linkOpener(rootView.getContext(), rootView.getContext().getResources().getString(R.string.github));
-            }
-        });
-
-        imageView.setOnClickListener(new View.OnClickListener() {
-            @Override
-            public void onClick(View v) {
-                linkOpener(rootView.getContext(), rootView.getContext().getResources().getString(R.string.github));
-            }
-        });
-
-        textView2.setOnClickListener(new View.OnClickListener() {
-            @Override
-            public void onClick(View v) {
-                linkOpener(rootView.getContext(), rootView.getContext().getResources().getString(R.string.penguins));
-            }
-        });
-
-        textView3.setOnClickListener(new View.OnClickListener() {
-            @Override
-            public void onClick(View v) {
-                linkOpener(rootView.getContext(), rootView.getContext().getResources().getString(R.string.inter));
-            }
-        });
-
-        textView4.setOnClickListener(new View.OnClickListener() {
-            @Override
-            public void onClick(View v) {
-                linkOpener(rootView.getContext(), BaseUrl);
-            }
-        });
+        textView1.setOnClickListener(v -> linkOpener(rootView.getContext(), rootView.getContext().getResources().getString(R.string.github)));
+
+        imageView.setOnClickListener(v -> linkOpener(rootView.getContext(), rootView.getContext().getResources().getString(R.string.github)));
+
+        textView2.setOnClickListener(v -> linkOpener(rootView.getContext(), rootView.getContext().getResources().getString(R.string.penguins)));
+
+        textView3.setOnClickListener(v -> linkOpener(rootView.getContext(), rootView.getContext().getResources().getString(R.string.inter)));
+
+        textView4.setOnClickListener(v -> linkOpener(rootView.getContext(), BaseUrl));
 
 
         LayoutManager = new LinearLayoutManager(rootView.getContext(), LinearLayoutManager.VERTICAL, false);

+ 3 - 9
app/src/main/java/club/thepenguins/android/fragments/AuthorPostFragment.java

@@ -91,16 +91,10 @@ public class AuthorPostFragment extends Fragment {
 
         recyclerView.setAdapter(adapter);
 
-        swipeContainer.setOnRefreshListener(new SwipeRefreshLayout.OnRefreshListener() {
-
-            @Override
-
-            public void onRefresh() {
-
-                adapter.clear();
-                getRetrofit(mParam1);
-            }
+        swipeContainer.setOnRefreshListener(() -> {
 
+            adapter.clear();
+            getRetrofit(mParam1);
         });
 
 

+ 10 - 20
app/src/main/java/club/thepenguins/android/fragments/HomeFragment.java

@@ -52,8 +52,9 @@ public class HomeFragment extends Fragment {
     public List<Posts> mListPost;
     private SwipeRefreshLayout swipeContainer;
     private ShimmerFrameLayout loader;
-    public int pageNumber = 1;
-    public int limit;
+    int pageNumber = 1;
+    int limit;
+    int perPage = 10;
     private static String TAG = "Home";
 
 
@@ -97,7 +98,7 @@ public class HomeFragment extends Fragment {
 
         list = new ArrayList<>();
 
-        getRetrofit(pageNumber, 10, rootView.getContext());
+        getRetrofit(pageNumber, perPage, rootView.getContext());
 
         adapter = new PostRecyclerAdapter(list, rootView.getContext());
         adapter.setStateRestorationPolicy(RecyclerView.Adapter.StateRestorationPolicy.PREVENT_WHEN_EMPTY);
@@ -109,14 +110,9 @@ public class HomeFragment extends Fragment {
                 if (!recyclerView.canScrollVertically(1) && (dy > 0)) {
                     if (!(String.valueOf(limit).isEmpty())) {
 
-                        getRetrofit(pageNumber, 10, rootView.getContext());
+                        getRetrofit(pageNumber, perPage, rootView.getContext());
 
-                        recyclerView.post(new Runnable() {
-                            @Override
-                            public void run() {
-                                adapter.notifyItemInserted(adapter.getItemCount() + 10);
-                            }
-                        });
+                        recyclerView.post(() -> adapter.notifyItemInserted(adapter.getItemCount() + perPage));
 
 
                     }
@@ -129,17 +125,11 @@ public class HomeFragment extends Fragment {
         });
 
 
-        swipeContainer.setOnRefreshListener(new SwipeRefreshLayout.OnRefreshListener() {
-
-            @Override
-
-            public void onRefresh() {
-
-                pageNumber = 1;
-                adapter.clear();
-                getRetrofit(pageNumber, 10, rootView.getContext());
-            }
+        swipeContainer.setOnRefreshListener(() -> {
 
+            pageNumber = 1;
+            adapter.clear();
+            getRetrofit(pageNumber, perPage, rootView.getContext());
         });
 
 

+ 4 - 10
app/src/main/java/club/thepenguins/android/fragments/LinuxFragment.java

@@ -102,17 +102,11 @@ public class LinuxFragment extends Fragment {
 
         recyclerView.setAdapter(adapter);
 
-        swipeContainer.setOnRefreshListener(new SwipeRefreshLayout.OnRefreshListener() {
-
-            @Override
-
-            public void onRefresh() {
-
-                adapter.clear();
-                getRetrofit(rootView.getContext(), mParam1);
-                textView.setVisibility(View.GONE);
-            }
+        swipeContainer.setOnRefreshListener(() -> {
 
+            adapter.clear();
+            getRetrofit(rootView.getContext(), mParam1);
+            textView.setVisibility(View.GONE);
         });
 
 

+ 11 - 2
app/src/main/res/layout/activity_post.xml

@@ -46,12 +46,12 @@
                     android:textSize="25sp" />
 
                 <ImageView
+                    android:id="@+id/share"
                     android:layout_width="0dp"
                     android:layout_height="match_parent"
                     android:layout_marginTop="15dp"
                     android:layout_marginBottom="15dp"
                     android:layout_weight="1"
-                    android:id="@+id/share"
                     android:src="@drawable/ic_baseline_share_24" />
             </LinearLayout>
 
@@ -89,13 +89,20 @@
                     android:layout_width="match_parent"
                     android:layout_height="wrap_content"
                     android:layout_below="@+id/shimmer_view_container"
+                    android:layout_marginStart="2dp"
+                    android:layout_marginEnd="2dp"
                     android:nestedScrollingEnabled="true" />
 
+                <View
+                    android:id="@+id/line"
+                    style="@style/Divider"
+                    android:layout_below="@+id/webview" />
+
                 <TextView
                     android:id="@+id/txtview"
                     android:layout_width="match_parent"
                     android:layout_height="wrap_content"
-                    android:layout_below="@+id/webview"
+                    android:layout_below="@+id/line"
                     android:layout_margin="10dp"
                     android:textColor="@color/textColor"
                     android:textSize="25sp"
@@ -106,6 +113,8 @@
                     android:layout_width="wrap_content"
                     android:layout_height="wrap_content"
                     android:layout_below="@id/txtview"
+                    android:layout_marginStart="1dp"
+                    android:layout_marginEnd="1dp"
                     android:visibility="gone" />
 
             </RelativeLayout>

+ 36 - 9
app/src/main/res/layout/fragment_about.xml

@@ -17,15 +17,28 @@
             android:layout_height="wrap_content"
             android:orientation="vertical">
 
-            <TextView
-                android:layout_width="wrap_content"
-                android:layout_height="wrap_content"
-                android:layout_gravity="center"
-                android:fontFamily="@font/unifrakturcook"
-                android:text="@string/logo"
-                android:id="@+id/bigP"
-                android:textColor="@color/textColor"
-                android:textSize="80sp" />
+            <com.facebook.shimmer.ShimmerFrameLayout
+                android:id="@+id/shimmer_view_container"
+                android:layout_width="match_parent"
+                android:layout_height="wrap_content">
+
+                <LinearLayout
+                    android:layout_width="match_parent"
+                    android:layout_height="wrap_content"
+                    android:gravity="center"
+                    android:orientation="vertical">
+
+                    <TextView
+                        android:id="@+id/bigP"
+                        android:layout_width="wrap_content"
+                        android:layout_height="wrap_content"
+                        android:layout_gravity="center"
+                        android:fontFamily="@font/unifrakturcook"
+                        android:text="@string/logo"
+                        android:textColor="@color/textColor"
+                        android:textSize="80sp" />
+                </LinearLayout>
+            </com.facebook.shimmer.ShimmerFrameLayout>
 
             <TextView
                 android:layout_width="match_parent"
@@ -159,6 +172,20 @@
 
             </LinearLayout>
 
+            <LinearLayout
+                android:layout_width="match_parent"
+                android:layout_height="wrap_content"
+                android:orientation="vertical"
+                android:layout_gravity="center">
+
+                <TextView
+                    android:layout_width="match_parent"
+                    android:layout_height="wrap_content"
+                    android:gravity="center"
+                    android:textColor="@color/textColor"
+                    android:text="@string/copyright" />
+            </LinearLayout>
+
 
         </LinearLayout>
     </androidx.core.widget.NestedScrollView>

+ 1 - 1
app/src/main/res/values-night/colors.xml

@@ -5,7 +5,7 @@
     <color name="colorAccent">#F77000</color>
     <color name="daynight_textcolor">#FF8222</color>
     <color name="switchColor">#F77000</color>
-    <color name="backgroundColor">#000000</color>
+    <color name="backgroundColor">#222222</color>
     <color name="textColor">#FFFFFF</color>
     <color name="shimmer_placeholder">#dddddd</color>
     <color name="black">#FF000000</color>

+ 6 - 0
app/src/main/res/values-night/styles.xml

@@ -15,6 +15,12 @@
         <item name="color">@android:color/white</item>
     </style>
 
+    <style name="Divider">
+        <item name="android:layout_width">match_parent</item>
+        <item name="android:layout_height">1dp</item>
+        <item name="android:background">?android:attr/listDivider</item>
+    </style>
+
     <style name="DrawerIconNight" parent="Widget.AppCompat.DrawerArrowToggle">
         <item name="color">@color/white</item>
     </style>

+ 3 - 0
app/src/main/res/values/strings.xml

@@ -29,7 +29,10 @@
         <item>Jamil Hasan Rahul</item>
         <item>Mahbub Hasan</item>
         <item>ソシオパス [404]</item>
+        <item>CoKilll</item>
+        <item>Codebid</item>
     </string-array>
 
+    <string name="copyright">\n © Techno FAQ Digital Media. \n All Rights Reserved.</string>
 
 </resources>

+ 6 - 0
app/src/main/res/values/styles.xml

@@ -11,6 +11,12 @@
         <item name="drawerArrowStyle">@style/DrawerArrowStyle</item>
     </style>
 
+    <style name="Divider">
+        <item name="android:layout_width">match_parent</item>
+        <item name="android:layout_height">1dp</item>
+        <item name="android:background">?android:attr/listDivider</item>
+    </style>
+
 
     <style name="DrawerIconDay" parent="Widget.AppCompat.DrawerArrowToggle">
         <item name="color">@color/black</item>