-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Resolved merge conflict by incorporating both suggestions.
- Loading branch information
Showing
10 changed files
with
350 additions
and
14 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
54 changes: 54 additions & 0 deletions
54
app/src/main/java/com/example/instagramclone_android/HomeFragment.java
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,54 @@ | ||
package com.example.instagramclone_android; | ||
|
||
import android.os.Bundle; | ||
|
||
import androidx.fragment.app.Fragment; | ||
import androidx.recyclerview.widget.LinearLayoutManager; | ||
import androidx.recyclerview.widget.RecyclerView; | ||
|
||
import android.view.LayoutInflater; | ||
import android.view.View; | ||
import android.view.ViewGroup; | ||
|
||
|
||
/** | ||
* A simple {@link Fragment} subclass. | ||
* Use the {@link HomeFragment#newInstance} factory method to | ||
* create an instance of this fragment. | ||
*/ | ||
public class HomeFragment extends Fragment { | ||
private RecyclerView recycler_view_story_section, recycler_view_post_section; | ||
|
||
|
||
public HomeFragment() { | ||
} | ||
|
||
public static HomeFragment newInstance() { | ||
HomeFragment fragment = new HomeFragment(); | ||
Bundle args = new Bundle(); | ||
fragment.setArguments(args); | ||
return fragment; | ||
} | ||
|
||
@Override | ||
public void onCreate(Bundle savedInstanceState) { | ||
super.onCreate(savedInstanceState); | ||
} | ||
|
||
@Override | ||
public View onCreateView(LayoutInflater inflater, ViewGroup container, | ||
Bundle savedInstanceState) { | ||
View view = inflater.inflate(R.layout.fragment_home, container, false); | ||
recycler_view_story_section = view.findViewById(R.id.recycler_view_story_section); | ||
recycler_view_story_section.setHasFixedSize(true); | ||
recycler_view_story_section.setLayoutManager(new LinearLayoutManager(view.getContext(), LinearLayoutManager.HORIZONTAL, false)); | ||
String[] usernames = {"gaurav","nihar","kunal","ajinkya","sakshi","nikita","aaditya","sandeep","mihir"}; | ||
recycler_view_story_section.setAdapter(new StoryAdapter(usernames)); | ||
|
||
recycler_view_post_section = view.findViewById(R.id.recycler_view_post_section); | ||
recycler_view_post_section.setHasFixedSize(true); | ||
recycler_view_post_section.setLayoutManager(new LinearLayoutManager(view.getContext(), LinearLayoutManager.VERTICAL, false)); | ||
recycler_view_post_section.setAdapter(new PostAdapter(usernames)); | ||
return view; | ||
} | ||
} |
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
Oops, something went wrong.