/**
* Print the values of the list
*/
public void print() {
System.out.print("LinkedList: [");
Node current = head;
Instantly share code, notes, and snippets.
- Dubai
ismkhanh
/ navigation_mobile_navigation
Created
July 22, 2018 11:51
This file contains hidden or 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
| <?xml version="1.0" encoding="utf-8"?> | |
| <navigation 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/mobile_navigation" | |
| app:startDestination="@id/firstFragment"> | |
| <fragment | |
| android:id="@+id/firstFragment" | |
| android:name="com.ik.navigationjetpack.FirstFragment" |
ismkhanh
/ navigation_firstfragment.kt
Created
July 22, 2018 10:27
This file contains hidden or 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
| package com.ik.navigationjetpack | |
| import android.os.Bundle | |
| import android.support.v4.app.Fragment | |
| import android.view.LayoutInflater | |
| import android.view.View | |
| import android.view.ViewGroup | |
| import androidx.navigation.Navigation | |
| import kotlinx.android.synthetic.main.fragment_first.* |
ismkhanh
/ navigation_second_fragment
Created
July 22, 2018 10:25
This file contains hidden or 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
| <?xml version="1.0" encoding="utf-8"?> | |
| <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" | |
| xmlns:tools="http://schemas.android.com/tools" | |
| android:layout_width="match_parent" | |
| android:layout_height="match_parent" | |
| android:orientation="vertical" | |
| tools:context=".SecondFragment" | |
| android:gravity="center"> | |
| <TextView |
ismkhanh
/ navigation_first_fragment_added
Created
July 22, 2018 09:45
This file contains hidden or 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
| <?xml version="1.0" encoding="utf-8"?> | |
| <navigation 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/mobile_navigation" | |
| app:startDestination="@id/firstFragment"> | |
| <fragment | |
| android:id="@+id/firstFragment" | |
| android:name="com.ik.navigationjetpack.FirstFragment" |
ismkhanh
/ navigation_first_fragment
Created
July 22, 2018 08:10
This file contains hidden or 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
| <?xml version="1.0" encoding="utf-8"?> | |
| <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" | |
| xmlns:tools="http://schemas.android.com/tools" | |
| android:layout_width="match_parent" | |
| android:layout_height="match_parent" | |
| android:gravity="center" | |
| android:orientation="vertical" | |
| tools:context=".FirstFragment"> | |
| <TextView |
ismkhanh
/ navigation_main_activity
Last active
July 22, 2018 08:05
This file contains hidden or 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
| <?xml version="1.0" encoding="utf-8"?> | |
| <LinearLayout 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" | |
| android:orientation="vertical" | |
| tools:context=".MainActivity"> | |
| <fragment |
ismkhanh
/ navigation_dependencies
Created
July 22, 2018 07:48
This file contains hidden or 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
| implementation 'android.arch.navigation:navigation-fragment:1.0.0-alpha01 | |
| implementation 'android.arch.navigation:navigation-ui:1.0.0-alpha01' |
ismkhanh
/ linkedlist_print_all_elements.md
Created
November 9, 2017 11:28
Print all the elements of LinkedList
ismkhanh
/ linkedlist_delete_item.md
Last active
November 9, 2017 11:30
Deleting item from LinkedList
/**
* Deletes the value, if present, from the list
*
* @param value to be deleted
*/
public void deleteItem(int value) {
if (head != null) { //if head is null no items to delete
ismkhanh
/ linkedlist_add_item_at_last.md
Last active
November 9, 2017 11:30
Adding an item to LinkedList
/**
* Adds elements at the end of the list
*
* @param value to be added
*/
public void addItem(int value) {
Node newNode = new Node(value);
NewerOlder