diff --git a/.idea/misc.xml b/.idea/misc.xml index fbb6828..5d19981 100644 --- a/.idea/misc.xml +++ b/.idea/misc.xml @@ -37,7 +37,7 @@ - + diff --git a/app/src/main/assets/jsons/item_categories.json b/app/src/main/assets/jsons/item_categories.json new file mode 100644 index 0000000..422ad05 --- /dev/null +++ b/app/src/main/assets/jsons/item_categories.json @@ -0,0 +1 @@ +[{"id":16,"name":"Bug Sprays"},{"id":1,"name":"Clothing"},{"id":8,"name":"Documents"},{"id":11,"name":"Electronics"},{"id":3,"name":"Equipment"},{"id":14,"name":"Furniture"},{"id":7,"name":"Groceries"},{"id":4,"name":"Medicines"},{"id":5,"name":"Personal Care"},{"id":15,"name":"Tools"},{"id":2,"name":"Utensils"}] \ No newline at end of file diff --git a/app/src/main/assets/jsons/items.json b/app/src/main/assets/jsons/items.json new file mode 100644 index 0000000..1f44734 --- /dev/null +++ b/app/src/main/assets/jsons/items.json @@ -0,0 +1 @@ +[{"id":384,"item_category_id":3,"name":"Accessory cord","description":"Useful when tying down your camp gear or setting up a belay anchor.","buy_urls":["http://www.backcountry.com/Store/catalog/search.jsp?q=accessory%20cord\u0026s=a"],"photo":"http://hikapro.com/system/backpack/items/photos/000/000/384/medium/AccessoryCord.jpg?1449412546","photo_thumb":"http://hikapro.com/system/backpack/items/photos/000/000/384/thumb/AccessoryCord.jpg?1449412546"},{"id":389,"item_category_id":3,"name":"Acetylene","description":"","buy_urls":[],"photo":"http://hikapro.com/system/backpack/items/photos/000/000/389/medium/Acetylene.jpg?1451147832","photo_thumb":"http://hikapro.com/system/backpack/items/photos/000/000/389/thumb/Acetylene.jpg?1451147832"},{"id":390,"item_category_id":3,"name":"Acetylene gas lamp","description":"","buy_urls":["http://google.com"],"photo":"http://hikapro.com/system/backpack/items/photos/000/000/390/medium/AcetyleneGasLamp.jpg?1451147857","photo_thumb":"http://hikapro.com/system/backpack/items/photos/000/000/390/thumb/AcetyleneGasLamp.jpg?1451147857"},{"id":290,"item_category_id":4,"name":"Analeptic","description":"Advise your doctor to get the right medicine prescribed.","buy_urls":["https://en.wikipedia.org/wiki/Analeptic"],"photo":"http://hikapro.com/system/backpack/items/photos/000/000/290/medium/Antibacterials.jpg?1452023609","photo_thumb":"http://hikapro.com/system/backpack/items/photos/000/000/290/thumb/Antibacterials.jpg?1452023609"},{"id":266,"item_category_id":4,"name":"Antibacterials","description":"Advise your doctor to choose the medicine.","buy_urls":[],"photo":"http://hikapro.com/system/backpack/items/photos/000/000/266/medium/Antibacterials.jpg?1451145119","photo_thumb":"http://hikapro.com/system/backpack/items/photos/000/000/266/thumb/Antibacterials.jpg?1451145119"},{"id":265,"item_category_id":4,"name":"Anti-diarrhoeal / activated charcoal","description":"Advise your doctor to get the right medicine prescribed.","buy_urls":["https://en.wikipedia.org/wiki/Antidiarrhoeal"],"photo":"http://hikapro.com/system/backpack/items/photos/000/000/265/medium/Antibacterials.jpg?1452019909","photo_thumb":"http://hikapro.com/system/backpack/items/photos/000/000/265/thumb/Antibacterials.jpg?1452019909"},{"id":284,"item_category_id":4,"name":"Antiemetic","description":"Advise your doctor to get the right medicine prescribed.","buy_urls":["https://en.wikipedia.org/wiki/Antiemetic"],"photo":"http://hikapro.com/system/backpack/items/photos/000/000/284/medium/Antibacterials.jpg?1452020084","photo_thumb":"http://hikapro.com/system/backpack/items/photos/000/000/284/thumb/Antibacterials.jpg?1452020084"},{"id":268,"item_category_id":4,"name":"Antihistamine","description":"Itching, sneezing, and inflammatory responses are suppressed by antihistamines. Advise your doctor to choose the medicine.","buy_urls":["https://en.wikipedia.org/wiki/Antihistamine"],"photo":"http://hikapro.com/system/backpack/items/photos/000/000/268/medium/Antihistamine.jpg?1451146696","photo_thumb":"http://hikapro.com/system/backpack/items/photos/000/000/268/thumb/Antihistamine.jpg?1451146696"},{"id":269,"item_category_id":4,"name":"Antiseptic","description":"Antiseptics are antimicrobial substances that are applied to living tissue/skin to reduce the possibility of infection, sepsis, or putrefaction.","buy_urls":["https://en.wikipedia.org/wiki/Antiseptic"],"photo":"http://hikapro.com/system/backpack/items/photos/000/000/269/medium/Antiseptic.jpg?1451146991","photo_thumb":"http://hikapro.com/system/backpack/items/photos/000/000/269/thumb/Antiseptic.jpg?1451146991"},{"id":289,"item_category_id":4,"name":"Antispasmodic ","description":"Advise your doctor to get the right medicine prescribed.","buy_urls":[],"photo":"http://hikapro.com/system/backpack/items/photos/000/000/289/medium/Antibacterials.jpg?1452021171","photo_thumb":"http://hikapro.com/system/backpack/items/photos/000/000/289/thumb/Antibacterials.jpg?1452021171"},{"id":365,"item_category_id":3,"name":"Backpack","description":"","buy_urls":["http://www.backcountry.com/Store/catalog/search.jsp?q=backpack\u0026s=u"],"photo":"http://hikapro.com/system/backpack/items/photos/000/000/365/medium/BackPack.jpg?1449412856","photo_thumb":"http://hikapro.com/system/backpack/items/photos/000/000/365/thumb/BackPack.jpg?1449412856"},{"id":428,"item_category_id":3,"name":"Backpack 20L","description":"","buy_urls":["http://www.backcountry.com/Store/catalog/search.jsp?q=backpacks\u0026s=a"],"photo":"http://hikapro.com/system/backpack/items/photos/000/000/428/medium/Backpack20.jpg?1452075315","photo_thumb":"http://hikapro.com/system/backpack/items/photos/000/000/428/thumb/Backpack20.jpg?1452075315"},{"id":360,"item_category_id":3,"name":"Backpack cover","description":"Light backpack raincover will protect it from getting wet, will save your clothes dry and light.","buy_urls":["http://www.backcountry.com/Store/catalog/search.jsp?q=backpack%20covers\u0026s=a"],"photo":"http://hikapro.com/system/backpack/items/photos/000/000/360/medium/BackpackCover.jpg?1449412930","photo_thumb":"http://hikapro.com/system/backpack/items/photos/000/000/360/thumb/BackpackCover.jpg?1449412930"},{"id":424,"item_category_id":3,"name":"Back protection","description":"","buy_urls":["http://www.backcountry.com/Store/catalog/search.jsp?q=back%20protection\u0026s=a"],"photo":"http://hikapro.com/system/backpack/items/photos/000/000/424/medium/BackProtection.jpg?1452074444","photo_thumb":"http://hikapro.com/system/backpack/items/photos/000/000/424/thumb/BackProtection.jpg?1452074444"},{"id":295,"item_category_id":1,"name":"Balaclava","description":"A balaclava is a form of cloth headgear designed to expose only part of the face. Depending on style and how it is worn, only the eyes, mouth and nose, or just the front of the face are unprotected. Versions with a full face opening may be rolled into a hat to cover the crown of the head or folded down as a collar around the neck.","buy_urls":["http://www.backcountry.com/Store/catalog/search.jsp?q=balaclava\u0026s=u"],"photo":"http://hikapro.com/system/backpack/items/photos/000/000/295/medium/Balaclava.jpg?1449413002","photo_thumb":"http://hikapro.com/system/backpack/items/photos/000/000/295/thumb/Balaclava.jpg?1449413002"},{"id":395,"item_category_id":11,"name":"Batteries","description":"Take enough batteries for all your electric devices: GPS, headlamp, camera and others.","buy_urls":["http://www.backcountry.com/Store/catalog/search.jsp?q=batteries\u0026s=a"],"photo":"http://hikapro.com/system/backpack/items/photos/000/000/395/medium/Batteries.jpg?1449413069","photo_thumb":"http://hikapro.com/system/backpack/items/photos/000/000/395/thumb/Batteries.jpg?1449413069"},{"id":314,"item_category_id":1,"name":"Boots","description":"","buy_urls":["http://www.backcountry.com/Store/catalog/search.jsp?q=hiking%20boots\u0026s=a"],"photo":"http://hikapro.com/system/backpack/items/photos/000/000/314/medium/Boots.jpg?1449413274","photo_thumb":"http://hikapro.com/system/backpack/items/photos/000/000/314/thumb/Boots.jpg?1449413274"},{"id":267,"item_category_id":4,"name":"Broad spectrum antibiotic","description":"Antibiotic that acts against a wide range of disease-causing bacteria. Advise your doctor to choose the medicine.","buy_urls":[],"photo":"http://hikapro.com/system/backpack/items/photos/000/000/267/medium/BroadSpectrum_Antibiotics.jpg?1449413455","photo_thumb":"http://hikapro.com/system/backpack/items/photos/000/000/267/thumb/BroadSpectrum_Antibiotics.jpg?1449413455"},{"id":249,"item_category_id":15,"name":"Bucket","description":"May be used to bring water, wash dishes, fruits or vegetables, gather berries or mushrooms.","buy_urls":["http://www.backcountry.com/sea-to-summit-folding-bucket"],"photo":"http://hikapro.com/system/backpack/items/photos/000/000/249/medium/Bucket.jpg?1449413359","photo_thumb":"http://hikapro.com/system/backpack/items/photos/000/000/249/thumb/Bucket.jpg?1449413359"},{"id":296,"item_category_id":1,"name":"Buff","description":"May be used as a hat, scarf, bandana, head or wrist band.","buy_urls":["http://www.backcountry.com/buff-uv-bug-slinger-buff-water-camo-print"],"photo":"http://hikapro.com/system/backpack/items/photos/000/000/296/medium/Buff.jpg?1449413472","photo_thumb":"http://hikapro.com/system/backpack/items/photos/000/000/296/thumb/Buff.jpg?1449413472"},{"id":282,"item_category_id":4,"name":"Burn gel or spray","description":"Advise your doctor to get the right medicine prescribed.","buy_urls":[],"photo":"http://hikapro.com/system/backpack/items/photos/000/000/282/medium/BurnGel.jpg?1452019290","photo_thumb":"http://hikapro.com/system/backpack/items/photos/000/000/282/thumb/BurnGel.jpg?1452019290"},{"id":370,"item_category_id":3,"name":"Camping canopy","description":"","buy_urls":[],"photo":"http://hikapro.com/system/backpack/items/photos/000/000/370/medium/Canopy.jpeg?1453300410","photo_thumb":"http://hikapro.com/system/backpack/items/photos/000/000/370/thumb/Canopy.jpeg?1453300410"},{"id":352,"item_category_id":3,"name":"Camping stove","description":"Necessary if you plan to cook or boil water on gas.","buy_urls":["http://www.backcountry.com/snow-peak-bipod-stove"],"photo":"http://hikapro.com/system/backpack/items/photos/000/000/352/medium/CampingStove.jpg?1449413664","photo_thumb":"http://hikapro.com/system/backpack/items/photos/000/000/352/thumb/CampingStove.jpg?1449413664"},{"id":312,"item_category_id":1,"name":"Camp shoes","description":"Spare shoes to let your feet relax","buy_urls":["http://www.backcountry.com/Store/catalog/search.jsp?q=hiking%20sandals\u0026s=a"],"photo":"http://hikapro.com/system/backpack/items/photos/000/000/312/medium/CampShoes.jpg?1449417075","photo_thumb":"http://hikapro.com/system/backpack/items/photos/000/000/312/thumb/CampShoes.jpg?1449417075"},{"id":366,"item_category_id":3,"name":"Candle","description":"Be careful with fire.\r\nA single candle may heat the air inside the tent to 5C.","buy_urls":["https://en.wikipedia.org/wiki/Candle"],"photo":"http://hikapro.com/system/backpack/items/photos/000/000/366/medium/Candle.jpg?1452020883","photo_thumb":"http://hikapro.com/system/backpack/items/photos/000/000/366/thumb/Candle.jpg?1452020883"},{"id":307,"item_category_id":1,"name":"Cap","description":"Cap, hat or alternative is essential in every trip to protect you head and face from sun, rain and wind.","buy_urls":["http://www.backcountry.com/arcteryx-big-a-cap"],"photo":"http://hikapro.com/system/backpack/items/photos/000/000/307/medium/Cap.jpg?1449414270","photo_thumb":"http://hikapro.com/system/backpack/items/photos/000/000/307/thumb/Cap.jpg?1449414270"},{"id":287,"item_category_id":4,"name":"Cardiovascular medication","description":"Advise your doctor to get the right medicine prescribed.","buy_urls":[],"photo":"http://hikapro.com/system/backpack/items/photos/000/000/287/medium/Antibacterials.jpg?1452020962","photo_thumb":"http://hikapro.com/system/backpack/items/photos/000/000/287/thumb/Antibacterials.jpg?1452020962"},{"id":235,"item_category_id":8,"name":"Cash and bank cards","description":"","buy_urls":[],"photo":"http://hikapro.com/system/backpack/items/photos/000/000/235/medium/CashAndCards.jpg?1451154423","photo_thumb":"http://hikapro.com/system/backpack/items/photos/000/000/235/thumb/CashAndCards.jpg?1451154423"},{"id":294,"item_category_id":14,"name":"Chairs","description":"","buy_urls":["http://www.backcountry.com/kelty-deluxe-lounge-chair"],"photo":"http://hikapro.com/system/backpack/items/photos/000/000/294/medium/Chair.jpg?1449414319","photo_thumb":"http://hikapro.com/system/backpack/items/photos/000/000/294/thumb/Chair.jpg?1449414319"},{"id":358,"item_category_id":3,"name":"Chalk","description":"Keeps your hands dry while climbing.","buy_urls":["http://www.backcountry.com/petzl-power-crunch-chalk"],"photo":"http://hikapro.com/system/backpack/items/photos/000/000/358/medium/Chalk.jpg?1449414362","photo_thumb":"http://hikapro.com/system/backpack/items/photos/000/000/358/thumb/Chalk.jpg?1449414362"},{"id":377,"item_category_id":3,"name":"Climbing rope","description":"Special rope with specific dinamyc and durability characteristics. Have it with you when travelling up or down.","buy_urls":["http://www.backcountry.com/Store/catalog/search.jsp?q=climbing%20ropes\u0026s=a"],"photo":"http://hikapro.com/system/backpack/items/photos/000/000/377/medium/ClimbingRope.jpg?1449414446","photo_thumb":"http://hikapro.com/system/backpack/items/photos/000/000/377/thumb/ClimbingRope.jpg?1449414446"},{"id":385,"item_category_id":3,"name":"Climbing shoes","description":"","buy_urls":["http://www.backcountry.com/Store/catalog/search.jsp?q=climbing%20shoes\u0026s=a"],"photo":"http://hikapro.com/system/backpack/items/photos/000/000/385/medium/ClimbingShoes.jpg?1449414896","photo_thumb":"http://hikapro.com/system/backpack/items/photos/000/000/385/thumb/ClimbingShoes.jpg?1449414896"},{"id":225,"item_category_id":5,"name":"Comb","description":"","buy_urls":["https://en.wikipedia.org/wiki/Comb"],"photo":"http://hikapro.com/system/backpack/items/photos/000/000/225/medium/Comb.jpg?1452020221","photo_thumb":"http://hikapro.com/system/backpack/items/photos/000/000/225/thumb/Comb.jpg?1452020221"},{"id":356,"item_category_id":3,"name":"Compass","description":"Will always help you orient, get back to the camp or continue floowing the route.","buy_urls":["http://www.backcountry.com/Store/catalog/search.jsp?q=compass\u0026s=a"],"photo":"http://hikapro.com/system/backpack/items/photos/000/000/356/medium/Compass.jpg?1449414960","photo_thumb":"http://hikapro.com/system/backpack/items/photos/000/000/356/thumb/Compass.jpg?1449414960"},{"id":213,"item_category_id":5,"name":"Cotton swabs","description":"Are commonly used in a variety of applications including first aid, cosmetics application, cleaning.","buy_urls":["https://en.wikipedia.org/wiki/Cotton_swab"],"photo":"http://hikapro.com/system/backpack/items/photos/000/000/213/medium/CottonSwabs.jpg?1451152942","photo_thumb":"http://hikapro.com/system/backpack/items/photos/000/000/213/thumb/CottonSwabs.jpg?1451152942"},{"id":272,"item_category_id":4,"name":"Cotton wool","description":"Absorbent Cotton is also known as Surgical Cotton or Cotton Wool and mainly used\r\nfor medical purposes in hospitals, nursing homes, dispensaries and at home (for first\r\naid) etc. because of its property of high fluid absorbency, it is better known among\r\nmasses as absorbent cotton.","buy_urls":[],"photo":"http://hikapro.com/system/backpack/items/photos/000/000/272/medium/CottonWool.jpg?1451152882","photo_thumb":"http://hikapro.com/system/backpack/items/photos/000/000/272/thumb/CottonWool.jpg?1451152882"},{"id":279,"item_category_id":4,"name":"Cough medicine","description":"Advise your doctor to get the right medicine prescribed.","buy_urls":["https://en.wikipedia.org/wiki/Cough_medicine"],"photo":"http://hikapro.com/system/backpack/items/photos/000/000/279/medium/Antihistamine.jpg?1452020042","photo_thumb":"http://hikapro.com/system/backpack/items/photos/000/000/279/thumb/Antihistamine.jpg?1452020042"},{"id":381,"item_category_id":3,"name":"Crampons","description":"Essential in alpine trips.","buy_urls":["http://www.backcountry.com/Store/catalog/search.jsp?q=crampons\u0026s=a"],"photo":"http://hikapro.com/system/backpack/items/photos/000/000/381/medium/Crampons.jpg?1449415018","photo_thumb":"http://hikapro.com/system/backpack/items/photos/000/000/381/thumb/Crampons.jpg?1449415018"},{"id":343,"item_category_id":2,"name":"Cutting board","description":"","buy_urls":["http://www.backcountry.com/Store/catalog/search.jsp?q=cutting%20boards\u0026s=a"],"photo":"http://hikapro.com/system/backpack/items/photos/000/000/343/medium/CuttingBoard.jpg?1449415076","photo_thumb":"http://hikapro.com/system/backpack/items/photos/000/000/343/thumb/CuttingBoard.jpg?1449415076"},{"id":409,"item_category_id":5,"name":"Deodorant","description":"Will keep your body fresh during the trip.","buy_urls":["https://en.wikipedia.org/wiki/Deodorant"],"photo":"http://hikapro.com/system/backpack/items/photos/000/000/409/medium/Deodorant.jpg?1451153290","photo_thumb":"http://hikapro.com/system/backpack/items/photos/000/000/409/thumb/Deodorant.jpg?1451153290"},{"id":406,"item_category_id":2,"name":"Disposable tableware","description":"Useful for picknick or car trip.","buy_urls":["http://www.backcountry.com/Store/catalog/search.jsp?q=disposable\u0026s=a"],"photo":"http://hikapro.com/system/backpack/items/photos/000/000/406/medium/DisposableTablewear.jpg?1449415151","photo_thumb":"http://hikapro.com/system/backpack/items/photos/000/000/406/thumb/DisposableTablewear.jpg?1449415151"},{"id":243,"item_category_id":15,"name":"Distilled water","description":"Can be used in car`s cooling and windshield cleaning systems, for washing and drinking.","buy_urls":["https://en.wikipedia.org/wiki/Distilled_water"],"photo":"http://hikapro.com/system/backpack/items/photos/000/000/243/medium/DistilledWater.jpg?1451153338","photo_thumb":"http://hikapro.com/system/backpack/items/photos/000/000/243/thumb/DistilledWater.jpg?1451153338"},{"id":271,"item_category_id":4,"name":"Dressings and bandages","description":"A bandage is a piece of material used either to support a medical device such as a dressing or splint, or on its own to provide support to or to restrict the movement of a part of the body. When used with a dressing, the dressing is applied directly on a wound, and a bandage used to hold the dressing in place.","buy_urls":["http://www.backcountry.com/Store/catalog/search.jsp?q=first%20aid%20kit%20backpacking\u0026s=a"],"photo":"http://hikapro.com/system/backpack/items/photos/000/000/271/medium/DressingsBandages.jpg?1449415262","photo_thumb":"http://hikapro.com/system/backpack/items/photos/000/000/271/thumb/DressingsBandages.jpg?1449415262"},{"id":233,"item_category_id":8,"name":"Driver's license","description":"Never leave your home without a piece of ID.","buy_urls":["https://en.wikipedia.org/wiki/Driver%27s_license"],"photo":"http://hikapro.com/system/backpack/items/photos/000/000/233/medium/DriversLicense.jpg?1451153080","photo_thumb":"http://hikapro.com/system/backpack/items/photos/000/000/233/thumb/DriversLicense.jpg?1451153080"},{"id":292,"item_category_id":4,"name":"Elastic bandage","description":"Elastic bandages are commonly used to treat muscle sprains and strains by reducing the flow of blood to a particular area by the application of even stable pressure which can restrict swelling at the place of injury. Elastic bandages are also used to treat bone fractures.","buy_urls":["https://en.wikipedia.org/wiki/Elastic_bandage"],"photo":"http://hikapro.com/system/backpack/items/photos/000/000/292/medium/ElasticBandage.jpg?1452023805","photo_thumb":"http://hikapro.com/system/backpack/items/photos/000/000/292/thumb/ElasticBandage.jpg?1452023805"},{"id":239,"item_category_id":8,"name":"Emergency phone numbers","description":"","buy_urls":[],"photo":"http://hikapro.com/system/backpack/items/photos/000/000/239/medium/Emergency.jpeg?1453300246","photo_thumb":"http://hikapro.com/system/backpack/items/photos/000/000/239/thumb/Emergency.jpeg?1453300246"},{"id":401,"item_category_id":11,"name":"Extension cord","description":"","buy_urls":[],"photo":"http://hikapro.com/system/backpack/items/photos/000/000/401/medium/ExtensionCord.jpeg?1453300886","photo_thumb":"http://hikapro.com/system/backpack/items/photos/000/000/401/thumb/ExtensionCord.jpeg?1453300886"},{"id":391,"item_category_id":11,"name":"Extra lamp","description":"Essential in trips, where a lamp is used more often, where a working lamp at hand is a requirement, while caving, for example.","buy_urls":["http://www.backcountry.com/Store/catalog/search.jsp?q=headlamps\u0026s=a"],"photo":"http://hikapro.com/system/backpack/items/photos/000/000/391/medium/HeadLamp.jpg?1451153542","photo_thumb":"http://hikapro.com/system/backpack/items/photos/000/000/391/thumb/HeadLamp.jpg?1451153542"},{"id":316,"item_category_id":1,"name":"Extra outwear","description":"","buy_urls":["http://www.backcountry.com/Store/catalog/search.jsp?q=outerwear\u0026s=a"],"photo":"","photo_thumb":""},{"id":311,"item_category_id":1,"name":"Extra pair of socks","description":"It is important to have enough of comfortable socks, suitable for youe type of travel.","buy_urls":["http://www.backcountry.com/Store/catalog/search.jsp?q=socks\u0026s=a"],"photo":"http://hikapro.com/system/backpack/items/photos/000/000/311/medium/ExtraSocks.jpg?1449415489","photo_thumb":"http://hikapro.com/system/backpack/items/photos/000/000/311/thumb/ExtraSocks.jpg?1449415489"},{"id":319,"item_category_id":1,"name":"Extra sun glasses","description":"","buy_urls":["http://www.backcountry.com/Store/catalog/search.jsp?q=sunglass\u0026s=a"],"photo":"http://hikapro.com/system/backpack/items/photos/000/000/319/medium/ExtraSunglasses.jpg?1449415560","photo_thumb":"http://hikapro.com/system/backpack/items/photos/000/000/319/thumb/ExtraSunglasses.jpg?1449415560"},{"id":317,"item_category_id":1,"name":"Extra underwear","description":"","buy_urls":["http://www.backcountry.com/Store/catalog/search.jsp?q=underwear\u0026s=a"],"photo":"http://hikapro.com/system/backpack/items/photos/000/000/317/medium/ExtraUnderwear.jpg?1449415670","photo_thumb":"http://hikapro.com/system/backpack/items/photos/000/000/317/thumb/ExtraUnderwear.jpg?1449415670"},{"id":257,"item_category_id":15,"name":"Extra work gloves","description":"","buy_urls":["http://www.backcountry.com/Store/catalog/search.jsp?q=work%20gloves\u0026s=a"],"photo":"http://hikapro.com/system/backpack/items/photos/000/000/257/medium/ExtraWorkGloves.jpg?1449415740","photo_thumb":"http://hikapro.com/system/backpack/items/photos/000/000/257/thumb/ExtraWorkGloves.jpg?1449415740"},{"id":273,"item_category_id":4,"name":"Eye drops","description":"Eye drops sometimes do not have medications in them and are only lubricating and tear-replacing solutions. Advise with your doctor to get the right medicine.","buy_urls":["https://en.wikipedia.org/wiki/Eye_drop"],"photo":"http://hikapro.com/system/backpack/items/photos/000/000/273/medium/EyeDrops.jpg?1451153216","photo_thumb":"http://hikapro.com/system/backpack/items/photos/000/000/273/thumb/EyeDrops.jpg?1451153216"},{"id":228,"item_category_id":5,"name":"Feminine hygiene","description":"","buy_urls":[],"photo":"http://hikapro.com/system/backpack/items/photos/000/000/228/medium/FeminineHygiene.jpg?1452021270","photo_thumb":"http://hikapro.com/system/backpack/items/photos/000/000/228/thumb/FeminineHygiene.jpg?1452021270"},{"id":274,"item_category_id":4,"name":"Fever reducer","description":"Always advise your doctor to chose the right medicine.","buy_urls":["https://en.wikipedia.org/wiki/Antipyretic"],"photo":"http://hikapro.com/system/backpack/items/photos/000/000/274/medium/FeverReducer.jpg?1451153660","photo_thumb":"http://hikapro.com/system/backpack/items/photos/000/000/274/thumb/FeverReducer.jpg?1451153660"},{"id":369,"item_category_id":3,"name":"Fire starting kit","description":"","buy_urls":["http://www.backcountry.com/Store/catalog/search.jsp?q=fire%20starter%20kits\u0026s=a"],"photo":"http://hikapro.com/system/backpack/items/photos/000/000/369/medium/FireStartingKit.jpg?1449415824","photo_thumb":"http://hikapro.com/system/backpack/items/photos/000/000/369/thumb/FireStartingKit.jpg?1449415824"},{"id":270,"item_category_id":4,"name":"First-aid kit","description":"First-aid kit is essential in each and every outdoor trip.","buy_urls":["http://www.backcountry.com/Store/catalog/search.jsp?q=first%20aid%20kits\u0026s=a"],"photo":"http://hikapro.com/system/backpack/items/photos/000/000/270/medium/FirstAidKit.jpg?1451147291","photo_thumb":"http://hikapro.com/system/backpack/items/photos/000/000/270/thumb/FirstAidKit.jpg?1451147291"},{"id":407,"item_category_id":11,"name":"Flash card","description":"","buy_urls":[],"photo":"http://hikapro.com/system/backpack/items/photos/000/000/407/medium/FlashCard.jpeg?1453301073","photo_thumb":"http://hikapro.com/system/backpack/items/photos/000/000/407/thumb/FlashCard.jpeg?1453301073"},{"id":331,"item_category_id":7,"name":"Food and drinks","description":"Always carry enough food and drinks when leaving a camp.","buy_urls":["http://www.backcountry.com/Store/catalog/search.jsp?q=foods\u0026s=a"],"photo":"http://hikapro.com/system/backpack/items/photos/000/000/331/medium/Food.jpg?1449415994","photo_thumb":"http://hikapro.com/system/backpack/items/photos/000/000/331/thumb/Food.jpg?1449415994"},{"id":334,"item_category_id":2,"name":"Food container","description":"Will keep food odors inside the container in order not to attract wild animals like bears to your camp, will keep your food safe from rodents.","buy_urls":["http://www.backcountry.com/Store/catalog/search.jsp?q=food%20containers\u0026s=a"],"photo":"http://hikapro.com/system/backpack/items/photos/000/000/334/medium/FoodCanister.jpg?1449416066","photo_thumb":"http://hikapro.com/system/backpack/items/photos/000/000/334/thumb/FoodCanister.jpg?1449416066"},{"id":333,"item_category_id":2,"name":"Fork","description":"Better use spork.","buy_urls":["http://www.backcountry.com/Store/catalog/search.jsp?q=sporks\u0026s=a"],"photo":"http://hikapro.com/system/backpack/items/photos/000/000/333/medium/Fork.jpg?1449416141","photo_thumb":"http://hikapro.com/system/backpack/items/photos/000/000/333/thumb/Fork.jpg?1449416141"},{"id":298,"item_category_id":1,"name":"Gaiters","description":"Gaiters protect your boots from snow getting in at winter trips, also keep you boots safe from sand, dust and insects during summer hikes.","buy_urls":["http://www.backcountry.com/Store/catalog/search.jsp?q=gaiters\u0026s=a"],"photo":"http://hikapro.com/system/backpack/items/photos/000/000/298/medium/Gaiters.jpg?1449416201","photo_thumb":"http://hikapro.com/system/backpack/items/photos/000/000/298/thumb/Gaiters.jpg?1449416201"},{"id":349,"item_category_id":3,"name":"Gas","description":"Make sure that you take enough gas for the trip, try to envisage supply options.","buy_urls":["http://www.backcountry.com/Store/catalog/search.jsp?q=gas%20stoves\u0026s=a"],"photo":"http://hikapro.com/system/backpack/items/photos/000/000/349/medium/Gas.jpg?1449416339","photo_thumb":"http://hikapro.com/system/backpack/items/photos/000/000/349/thumb/Gas.jpg?1449416339"},{"id":422,"item_category_id":3,"name":"Goggles","description":"","buy_urls":["http://www.backcountry.com/Store/catalog/search.jsp?q=ski%20goggles\u0026s=a"],"photo":"http://hikapro.com/system/backpack/items/photos/000/000/422/medium/Goggles.jpg?1452074226","photo_thumb":"http://hikapro.com/system/backpack/items/photos/000/000/422/thumb/Goggles.jpg?1452074226"},{"id":394,"item_category_id":11,"name":"GPS device","description":"Equipped with actual maps will always help you find the right route, way back to the camp or home. Have enough batteries ready for it.","buy_urls":["http://www.backcountry.com/Store/catalog/search.jsp?q=gps\u0026s=a"],"photo":"http://hikapro.com/system/backpack/items/photos/000/000/394/medium/GPS.jpg?1449416384","photo_thumb":"http://hikapro.com/system/backpack/items/photos/000/000/394/thumb/GPS.jpg?1449416384"},{"id":393,"item_category_id":11,"name":"Hairdryer","description":"","buy_urls":[],"photo":"http://hikapro.com/system/backpack/items/photos/000/000/393/medium/HairDryer.jpeg?1453300939","photo_thumb":"http://hikapro.com/system/backpack/items/photos/000/000/393/thumb/HairDryer.jpeg?1453300939"},{"id":251,"item_category_id":15,"name":"Hammer","description":"Useful in repairing and setting up a camp.","buy_urls":["http://www.backcountry.com/Store/catalog/search.jsp?q=hammers\u0026s=a"],"photo":"http://hikapro.com/system/backpack/items/photos/000/000/251/medium/Hammer.jpg?1449416493","photo_thumb":"http://hikapro.com/system/backpack/items/photos/000/000/251/thumb/Hammer.jpg?1449416493"},{"id":223,"item_category_id":5,"name":"Hand sanitizer","description":"A hand antiseptic, hand disinfectant, hand sanitiser or hand sanitizer is a supplement or alternative to hand washing with soap and water.","buy_urls":["http://www.backcountry.com/Store/catalog/search.jsp?q=sanitizer\u0026s=a"],"photo":"http://hikapro.com/system/backpack/items/photos/000/000/223/medium/HandSanitizer.jpg?1449416442","photo_thumb":"http://hikapro.com/system/backpack/items/photos/000/000/223/thumb/HandSanitizer.jpg?1449416442"},{"id":387,"item_category_id":3,"name":"Harness","description":"","buy_urls":["http://www.backcountry.com/Store/catalog/search.jsp?q=harness\u0026s=a"],"photo":"http://hikapro.com/system/backpack/items/photos/000/000/387/medium/Harness.jpg?1449416542","photo_thumb":"http://hikapro.com/system/backpack/items/photos/000/000/387/thumb/Harness.jpg?1449416542"},{"id":299,"item_category_id":1,"name":"Hat","description":"Hat or alternative is essential in every trip to protect you head and face from sun, rain and wind.","buy_urls":["http://www.backcountry.com/Store/catalog/search.jsp?q=hat\u0026s=u"],"photo":"http://hikapro.com/system/backpack/items/photos/000/000/299/medium/Hat.jpg?1449416618","photo_thumb":"http://hikapro.com/system/backpack/items/photos/000/000/299/thumb/Hat.jpg?1449416618"},{"id":371,"item_category_id":3,"name":"Haul bag","description":"","buy_urls":["http://www.backcountry.com/Store/catalog/search.jsp?q=haul%20bags\u0026s=a"],"photo":"http://hikapro.com/system/backpack/items/photos/000/000/371/medium/HaulBag.jpg?1449416663","photo_thumb":"http://hikapro.com/system/backpack/items/photos/000/000/371/thumb/HaulBag.jpg?1449416663"},{"id":397,"item_category_id":11,"name":"Head lamp","description":"","buy_urls":["http://www.backcountry.com/Store/catalog/search.jsp?q=headlamps\u0026s=a"],"photo":"http://hikapro.com/system/backpack/items/photos/000/000/397/medium/HeadLamp.jpg?1449416712","photo_thumb":"http://hikapro.com/system/backpack/items/photos/000/000/397/thumb/HeadLamp.jpg?1449416712"},{"id":405,"item_category_id":11,"name":"Headphones","description":"Travelling with your favourite music is easier.","buy_urls":["http://www.backcountry.com/Store/catalog/search.jsp?q=head%20phones\u0026s=a"],"photo":"http://hikapro.com/system/backpack/items/photos/000/000/405/medium/HeadPhones.jpg?1449416765","photo_thumb":"http://hikapro.com/system/backpack/items/photos/000/000/405/thumb/HeadPhones.jpg?1449416765"},{"id":324,"item_category_id":1,"name":"Heavyweight thermal underwear","description":"","buy_urls":["http://www.backcountry.com/Store/catalog/search.jsp?q=thermal%20underwear\u0026s=a"],"photo":"http://hikapro.com/system/backpack/items/photos/000/000/324/medium/HeavyThermalUnderwear.jpg?1449416822","photo_thumb":"http://hikapro.com/system/backpack/items/photos/000/000/324/thumb/HeavyThermalUnderwear.jpg?1449416822"},{"id":380,"item_category_id":3,"name":"Helmet","description":"Protects your head from rocks and ice during mountain trips.","buy_urls":["http://www.backcountry.com/Store/catalog/search.jsp?q=helmets\u0026s=a"],"photo":"http://hikapro.com/system/backpack/items/photos/000/000/380/medium/Helmet.jpg?1449416870","photo_thumb":"http://hikapro.com/system/backpack/items/photos/000/000/380/thumb/Helmet.jpg?1449416870"},{"id":325,"item_category_id":1,"name":"Hiking boots","description":"","buy_urls":["http://www.backcountry.com/Store/catalog/search.jsp?q=hiking%20boots\u0026s=a"],"photo":"http://hikapro.com/system/backpack/items/photos/000/000/325/medium/HikingBoots.jpg?1449416971","photo_thumb":"http://hikapro.com/system/backpack/items/photos/000/000/325/thumb/HikingBoots.jpg?1449416971"},{"id":347,"item_category_id":3,"name":"Hiking sauna","description":"","buy_urls":[],"photo":"http://hikapro.com/system/backpack/items/photos/000/000/347/medium/HikingSauna.jpg?1451151417","photo_thumb":"http://hikapro.com/system/backpack/items/photos/000/000/347/thumb/HikingSauna.jpg?1451151417"},{"id":326,"item_category_id":1,"name":"Hiking socks","description":"","buy_urls":["http://www.backcountry.com/Store/catalog/search.jsp?q=hiking%20socks\u0026s=a"],"photo":"http://hikapro.com/system/backpack/items/photos/000/000/326/medium/HikingSocks.jpg?1449417121","photo_thumb":"http://hikapro.com/system/backpack/items/photos/000/000/326/thumb/HikingSocks.jpg?1449417121"},{"id":392,"item_category_id":3,"name":"Human waste bags","description":"Useful in caving and other trips in order to take away human wastes and keep the nature clean.","buy_urls":["http://www.backcountry.com/Store/catalog/search.jsp?q=waste%20bags\u0026s=a"],"photo":"http://hikapro.com/system/backpack/items/photos/000/000/392/medium/HumanWasteBags.jpg?1449417163","photo_thumb":"http://hikapro.com/system/backpack/items/photos/000/000/392/thumb/HumanWasteBags.jpg?1449417163"},{"id":351,"item_category_id":3,"name":"Hydration pack","description":"Allows to take more drinking water that regular bottle, to drink on the go without unnecessary stops and fear to drop or lose the bottle.","buy_urls":["http://www.backcountry.com/Store/catalog/search.jsp?q=hydration%20packs\u0026s=a"],"photo":"http://hikapro.com/system/backpack/items/photos/000/000/351/medium/HydrationPack.jpg?1449417208","photo_thumb":"http://hikapro.com/system/backpack/items/photos/000/000/351/thumb/HydrationPack.jpg?1449417208"},{"id":382,"item_category_id":3,"name":"Ice axe","description":"Choose by weight and usage comfortability.","buy_urls":["http://www.backcountry.com/Store/catalog/search.jsp?q=ice%20axes\u0026s=a"],"photo":"http://hikapro.com/system/backpack/items/photos/000/000/382/medium/IceAxe.jpg?1449417256","photo_thumb":"http://hikapro.com/system/backpack/items/photos/000/000/382/thumb/IceAxe.jpg?1449417256"},{"id":275,"item_category_id":4,"name":"Individual medicines","description":"Advise your doctor to pack an individual first-aid kit with all personal medicines for all your chronic illnesses.","buy_urls":["http://www.backcountry.com/Store/catalog/search.jsp?q=medical%20kits\u0026s=a"],"photo":"http://hikapro.com/system/backpack/items/photos/000/000/275/medium/IndividMedicine.jpg?1449417320","photo_thumb":"http://hikapro.com/system/backpack/items/photos/000/000/275/thumb/IndividMedicine.jpg?1449417320"},{"id":346,"item_category_id":16,"name":"Insects repellent","description":"","buy_urls":["http://www.backcountry.com/Store/catalog/search.jsp?q=repellents\u0026s=a"],"photo":"http://hikapro.com/system/backpack/items/photos/000/000/346/medium/InsectsRepell.jpg?1449417399","photo_thumb":"http://hikapro.com/system/backpack/items/photos/000/000/346/thumb/InsectsRepell.jpg?1449417399"},{"id":263,"item_category_id":15,"name":"Insulating tape","description":"Useg as a fixing tool in caravaning and hiking trips.","buy_urls":["http://www.backcountry.com/Store/catalog/search.jsp?q=tape\u0026s=a"],"photo":"http://hikapro.com/system/backpack/items/photos/000/000/263/medium/InsulatingTape.jpg?1449417477","photo_thumb":"http://hikapro.com/system/backpack/items/photos/000/000/263/thumb/InsulatingTape.jpg?1449417477"},{"id":238,"item_category_id":8,"name":"Insurance policy","description":"","buy_urls":[],"photo":"http://hikapro.com/system/backpack/items/photos/000/000/238/medium/insurance.jpeg?1453300115","photo_thumb":"http://hikapro.com/system/backpack/items/photos/000/000/238/thumb/insurance.jpeg?1453300115"},{"id":277,"item_category_id":4,"name":"Intestinal infection medication","description":"Advise your doctor to get the right medicine prescribed.","buy_urls":[],"photo":"http://hikapro.com/system/backpack/items/photos/000/000/277/medium/BroadSpectrum_Antibiotics.jpg?1452023163","photo_thumb":"http://hikapro.com/system/backpack/items/photos/000/000/277/thumb/BroadSpectrum_Antibiotics.jpg?1452023163"},{"id":375,"item_category_id":3,"name":"Kayak","description":"You may find a suitable tree and hollow out your own kayak, but better take a modern one and save the nature.","buy_urls":["http://www.backcountry.com/Store/catalog/search.jsp?q=kayaks\u0026s=a"],"photo":"http://hikapro.com/system/backpack/items/photos/000/000/375/medium/Kayak.jpg?1449417666","photo_thumb":"http://hikapro.com/system/backpack/items/photos/000/000/375/thumb/Kayak.jpg?1449417666"},{"id":341,"item_category_id":2,"name":"Kettle","description":"","buy_urls":["http://www.backcountry.com/Store/catalog/search.jsp?q=kettle%20pot\u0026s=a"],"photo":"http://hikapro.com/system/backpack/items/photos/000/000/341/medium/Kettle.jpg?1449417740","photo_thumb":"http://hikapro.com/system/backpack/items/photos/000/000/341/thumb/Kettle.jpg?1449417740"},{"id":361,"item_category_id":3,"name":"Knee pads","description":"Support the knees during walking and protect during setting up a camp.","buy_urls":["http://www.backcountry.com/Store/catalog/search.jsp?q=knee%20pads\u0026s=a"],"photo":"http://hikapro.com/system/backpack/items/photos/000/000/361/medium/KneePads.jpg?1449417799","photo_thumb":"http://hikapro.com/system/backpack/items/photos/000/000/361/thumb/KneePads.jpg?1449417799"},{"id":338,"item_category_id":2,"name":"Knife","description":"Every tourist needs a knife in his backpack.","buy_urls":["http://www.backcountry.com/Store/catalog/search.jsp?q=knife\u0026s=u"],"photo":"http://hikapro.com/system/backpack/items/photos/000/000/338/medium/Knife.jpg?1449417846","photo_thumb":"http://hikapro.com/system/backpack/items/photos/000/000/338/thumb/Knife.jpg?1449417846"},{"id":342,"item_category_id":2,"name":"Ladle","description":"","buy_urls":["http://www.backcountry.com/Store/catalog/search.jsp?q=ladle\u0026s=a"],"photo":"http://hikapro.com/system/backpack/items/photos/000/000/342/medium/Ladle.jpg?1449417925","photo_thumb":"http://hikapro.com/system/backpack/items/photos/000/000/342/thumb/Ladle.jpg?1449417925"},{"id":260,"item_category_id":15,"name":"Lamp repair kit","description":"","buy_urls":[],"photo":"","photo_thumb":""},{"id":221,"item_category_id":5,"name":"Laundry soap","description":"Travelling in fresh and clean clothes is easier and more enjoyable.","buy_urls":["https://en.wikipedia.org/wiki/Laundry_detergent"],"photo":"http://hikapro.com/system/backpack/items/photos/000/000/221/medium/LaundrySoap.jpg?1451154375","photo_thumb":"http://hikapro.com/system/backpack/items/photos/000/000/221/thumb/LaundrySoap.jpg?1451154375"},{"id":288,"item_category_id":4,"name":"Laxative","description":"Advise your doctor to get the right medicine prescribed.","buy_urls":[],"photo":"http://hikapro.com/system/backpack/items/photos/000/000/288/medium/Antibacterials.jpg?1452021127","photo_thumb":"http://hikapro.com/system/backpack/items/photos/000/000/288/thumb/Antibacterials.jpg?1452021127"},{"id":376,"item_category_id":3,"name":"Life vest","description":"","buy_urls":["http://www.backcountry.com/Store/catalog/search.jsp?q=life%20vest\u0026s=a"],"photo":"http://hikapro.com/system/backpack/items/photos/000/000/376/medium/LifeVest.jpg?1449418037","photo_thumb":"http://hikapro.com/system/backpack/items/photos/000/000/376/thumb/LifeVest.jpg?1449418037"},{"id":244,"item_category_id":15,"name":"Lifting jack","description":"Can be used for wheel changing or while freeing a stuck vehicle.","buy_urls":["https://en.wikipedia.org/wiki/Jack_(device)"],"photo":"http://hikapro.com/system/backpack/items/photos/000/000/244/medium/LiftingJack.jpg?1451153476","photo_thumb":"http://hikapro.com/system/backpack/items/photos/000/000/244/thumb/LiftingJack.jpg?1451153476"},{"id":396,"item_category_id":11,"name":"Light bulb","description":"We recommend having an extra light bulb during the trips with active lamp usage.","buy_urls":["https://en.wikipedia.org/wiki/Lamp_(electrical_component)"],"photo":"","photo_thumb":""},{"id":306,"item_category_id":1,"name":"Light fleece hoodie","description":"Fleece outwear saves your warmth and removes moisture better.","buy_urls":["http://www.backcountry.com/Store/catalog/search.jsp?q=hoodies\u0026s=a"],"photo":"http://hikapro.com/system/backpack/items/photos/000/000/306/medium/LightFleeceHoodie.jpg?1449418151","photo_thumb":"http://hikapro.com/system/backpack/items/photos/000/000/306/thumb/LightFleeceHoodie.jpg?1449418151"},{"id":305,"item_category_id":1,"name":"Light jacket","description":"Take into account weather and temperature conditions while preparing and selecting outerwear. Light jacket may come in handy even during summer time hikes.","buy_urls":["http://www.backcountry.com/Store/catalog/search.jsp?q=light%20jackets\u0026s=a"],"photo":"http://hikapro.com/system/backpack/items/photos/000/000/305/medium/LiteJacket.jpg?1449418214","photo_thumb":"http://hikapro.com/system/backpack/items/photos/000/000/305/thumb/LiteJacket.jpg?1449418214"},{"id":315,"item_category_id":1,"name":"Lightweight thermal underwear","description":"","buy_urls":["http://www.backcountry.com/Store/catalog/search.jsp?q=lightweight%20underwear\u0026s=a"],"photo":"http://hikapro.com/system/backpack/items/photos/000/000/315/medium/LiteThermalUnder.jpg?1449418284","photo_thumb":"http://hikapro.com/system/backpack/items/photos/000/000/315/thumb/LiteThermalUnder.jpg?1449418284"},{"id":215,"item_category_id":5,"name":"Lip balm","description":"Protects lips from chapping in any trip.","buy_urls":["http://www.backcountry.com/Store/catalog/search.jsp?q=lip%20balms\u0026s=a"],"photo":"http://hikapro.com/system/backpack/items/photos/000/000/215/medium/LipBalm.jpg?1449418345","photo_thumb":"http://hikapro.com/system/backpack/items/photos/000/000/215/thumb/LipBalm.jpg?1449418345"},{"id":241,"item_category_id":15,"name":"Lug wrench","description":"Be sure to come in handy if you need to replace the wheel. A type of socket wrench used to loosen and tighten lug nuts on automobile wheels.","buy_urls":["https://en.wikipedia.org/wiki/Lug_wrench"],"photo":"http://hikapro.com/system/backpack/items/photos/000/000/241/medium/LugWrench.jpg?1451150607","photo_thumb":"http://hikapro.com/system/backpack/items/photos/000/000/241/thumb/LugWrench.jpg?1451150607"},{"id":354,"item_category_id":3,"name":"Map","description":"We recommend to have a paper map in waterproof cover, even if you travel with GPS device.","buy_urls":["http://www.backcountry.com/Store/catalog/search.jsp?q=maps\u0026s=a"],"photo":"http://hikapro.com/system/backpack/items/photos/000/000/354/medium/Map.jpg?1449418415","photo_thumb":"http://hikapro.com/system/backpack/items/photos/000/000/354/thumb/Map.jpg?1449418415"},{"id":258,"item_category_id":15,"name":"Mat repair kit","description":"","buy_urls":["http://www.backcountry.com/sleeping-pad-accessories"],"photo":"http://hikapro.com/system/backpack/items/photos/000/000/258/medium/MatRepairKit.jpg?1449418479","photo_thumb":"http://hikapro.com/system/backpack/items/photos/000/000/258/thumb/MatRepairKit.jpg?1449418479"},{"id":335,"item_category_id":2,"name":"Metal pot","description":"Choose a pot depending on amount of people you are going to cook for.","buy_urls":["http://www.backcountry.com/Store/catalog/search.jsp?q=pots\u0026s=a"],"photo":"http://hikapro.com/system/backpack/items/photos/000/000/335/medium/MetalPot.jpg?1449418527","photo_thumb":"http://hikapro.com/system/backpack/items/photos/000/000/335/thumb/MetalPot.jpg?1449418527"},{"id":323,"item_category_id":1,"name":"Midweight thermal underwear","description":"","buy_urls":["http://www.backcountry.com/Store/catalog/search.jsp?q=midweight%20thermal%20underwear\u0026s=a"],"photo":"http://hikapro.com/system/backpack/items/photos/000/000/323/medium/MidweightThermal.jpg?1449418585","photo_thumb":"http://hikapro.com/system/backpack/items/photos/000/000/323/thumb/MidweightThermal.jpg?1449418585"},{"id":313,"item_category_id":1,"name":"Mittens","description":"","buy_urls":["http://www.backcountry.com/Store/catalog/search.jsp?q=mittens\u0026s=a"],"photo":"http://hikapro.com/system/backpack/items/photos/000/000/313/medium/Mittens.jpg?1449418807","photo_thumb":"http://hikapro.com/system/backpack/items/photos/000/000/313/thumb/Mittens.jpg?1449418807"},{"id":400,"item_category_id":11,"name":"Mobile phone","description":"","buy_urls":[],"photo":"http://hikapro.com/system/backpack/items/photos/000/000/400/medium/Phone.jpeg?1453300179","photo_thumb":"http://hikapro.com/system/backpack/items/photos/000/000/400/thumb/Phone.jpeg?1453300179"},{"id":345,"item_category_id":16,"name":"Mosquito repellent","description":"","buy_urls":["http://www.backcountry.com/Store/catalog/search.jsp?q=repellents\u0026s=a"],"photo":"http://hikapro.com/system/backpack/items/photos/000/000/345/medium/InsectsRepell.jpg?1449418862","photo_thumb":"http://hikapro.com/system/backpack/items/photos/000/000/345/thumb/InsectsRepell.jpg?1449418862"},{"id":245,"item_category_id":15,"name":"Motor oil","description":"We recommend having it in your trunk for every car trip.","buy_urls":["https://en.wikipedia.org/wiki/Motor_oil"],"photo":"http://hikapro.com/system/backpack/items/photos/000/000/245/medium/MotorOil.jpg?1451154281","photo_thumb":"http://hikapro.com/system/backpack/items/photos/000/000/245/thumb/MotorOil.jpg?1451154281"},{"id":300,"item_category_id":1,"name":"Mountaineering boots","description":"Boots should be waterproof, lightweight, designed with crampon climbing as a focus, but able to climb rock without crampon, with stiff platform of the rigid or semi rigid sole.","buy_urls":["http://www.backcountry.com/Store/catalog/search.jsp?q=mountain%20boots\u0026s=a"],"photo":"http://hikapro.com/system/backpack/items/photos/000/000/300/medium/MountainBoots.jpg?1449418940","photo_thumb":"http://hikapro.com/system/backpack/items/photos/000/000/300/thumb/MountainBoots.jpg?1449418940"},{"id":404,"item_category_id":11,"name":"MP3 player","description":"","buy_urls":["https://en.wikipedia.org/wiki/MP3_player"],"photo":"http://hikapro.com/system/backpack/items/photos/000/000/404/medium/Mp3Player.jpg?1452019981","photo_thumb":"http://hikapro.com/system/backpack/items/photos/000/000/404/thumb/Mp3Player.jpg?1452019981"},{"id":336,"item_category_id":2,"name":"Mug","description":"You may eat and drink from the mug.","buy_urls":["http://www.backcountry.com/Store/catalog/search.jsp?q=mugs\u0026s=a"],"photo":"http://hikapro.com/system/backpack/items/photos/000/000/336/medium/Mug.jpg?1449419059","photo_thumb":"http://hikapro.com/system/backpack/items/photos/000/000/336/thumb/Mug.jpg?1449419059"},{"id":254,"item_category_id":15,"name":"Multi-tool","description":"It is useful for minor repairs of equipment.","buy_urls":["http://www.backcountry.com/Store/catalog/search.jsp?q=multi%20tools\u0026s=a"],"photo":"http://hikapro.com/system/backpack/items/photos/000/000/254/medium/Multitool.jpg?1449419107","photo_thumb":"http://hikapro.com/system/backpack/items/photos/000/000/254/thumb/Multitool.jpg?1449419107"},{"id":250,"item_category_id":15,"name":"Nails","description":"Not a frequently used item, but having a hangful of nails in your toolbox gives you a chance to make a bench or a table if needed.","buy_urls":["https://en.wikipedia.org/wiki/Nail_(fastener)"],"photo":"http://hikapro.com/system/backpack/items/photos/000/000/250/medium/Nails.jpg?1451153132","photo_thumb":"http://hikapro.com/system/backpack/items/photos/000/000/250/thumb/Nails.jpg?1451153132"},{"id":222,"item_category_id":5,"name":"Nail scissors","description":"Keep your fingers and nails clear and maintained.","buy_urls":["http://www.backcountry.com/Store/catalog/search.jsp?q=scissors\u0026s=a"],"photo":"http://hikapro.com/system/backpack/items/photos/000/000/222/medium/NailScissors.jpg?1449419399","photo_thumb":"http://hikapro.com/system/backpack/items/photos/000/000/222/thumb/NailScissors.jpg?1449419399"},{"id":226,"item_category_id":5,"name":"Napkins","description":"","buy_urls":[],"photo":"http://hikapro.com/system/backpack/items/photos/000/000/226/medium/Napkins.jpg?1452021077","photo_thumb":"http://hikapro.com/system/backpack/items/photos/000/000/226/thumb/Napkins.jpg?1452021077"},{"id":283,"item_category_id":4,"name":"Nasal drops","description":"Advise your doctor to get the right medicine prescribed.","buy_urls":[],"photo":"http://hikapro.com/system/backpack/items/photos/000/000/283/medium/NasalDrops.jpg?1452023564","photo_thumb":"http://hikapro.com/system/backpack/items/photos/000/000/283/thumb/NasalDrops.jpg?1452023564"},{"id":411,"item_category_id":8,"name":"Notebook","description":"Useful for travel writing and calculations. It can be used to ignite the fire too.","buy_urls":[],"photo":"http://hikapro.com/system/backpack/items/photos/000/000/411/medium/Notebook.jpg?1451152698","photo_thumb":"http://hikapro.com/system/backpack/items/photos/000/000/411/thumb/Notebook.jpg?1451152698"},{"id":286,"item_category_id":4,"name":"Oral rehydration solution","description":"Advise your doctor to get the right medicine prescribed.","buy_urls":["https://en.wikipedia.org/wiki/Oral_rehydration_therapy"],"photo":"http://hikapro.com/system/backpack/items/photos/000/000/286/medium/Antihistamine.jpg?1452020548","photo_thumb":"http://hikapro.com/system/backpack/items/photos/000/000/286/thumb/Antihistamine.jpg?1452020548"},{"id":280,"item_category_id":4,"name":"Pain reliever","description":"Advise your doctor to get the right medicine prescribed.","buy_urls":["https://en.wikipedia.org/wiki/Analgesic"],"photo":"http://hikapro.com/system/backpack/items/photos/000/000/280/medium/Antibacterials.jpg?1452018459","photo_thumb":"http://hikapro.com/system/backpack/items/photos/000/000/280/thumb/Antibacterials.jpg?1452018459"},{"id":281,"item_category_id":4,"name":"Pain reliever for sprains and strains","description":"Advise your doctor to get the right medicine prescribed.","buy_urls":["https://en.wikipedia.org/wiki/Strain_(injury)"],"photo":"http://hikapro.com/system/backpack/items/photos/000/000/281/medium/Antihistamine.jpg?1452018550","photo_thumb":"http://hikapro.com/system/backpack/items/photos/000/000/281/thumb/Antihistamine.jpg?1452018550"},{"id":329,"item_category_id":1,"name":"Pants","description":"","buy_urls":["http://www.backcountry.com/Store/catalog/search.jsp?q=pants"],"photo":"http://hikapro.com/system/backpack/items/photos/000/000/329/medium/Pants.jpg?1449419805","photo_thumb":"http://hikapro.com/system/backpack/items/photos/000/000/329/thumb/Pants.jpg?1449419805"},{"id":237,"item_category_id":8,"name":"Passport","description":"Don`t forget your passport when travelling abroad.","buy_urls":[],"photo":"http://hikapro.com/system/backpack/items/photos/000/000/237/medium/Passport.jpg?1452019799","photo_thumb":"http://hikapro.com/system/backpack/items/photos/000/000/237/thumb/Passport.jpg?1452019799"},{"id":412,"item_category_id":8,"name":"Pencil","description":"It`s durable markings are resistant to moisture, most chemicals, ultraviolet radiation, and natural aging.","buy_urls":["https://en.wikipedia.org/wiki/Pencil"],"photo":"http://hikapro.com/system/backpack/items/photos/000/000/412/medium/Pencil.jpg?1451154017","photo_thumb":"http://hikapro.com/system/backpack/items/photos/000/000/412/thumb/Pencil.jpg?1451154017"},{"id":402,"item_category_id":11,"name":"Phone car charger","description":"Keep your phone charged while on the road.","buy_urls":["http://www.backcountry.com/Store/catalog/search.jsp?q=car%20charger\u0026s=a"],"photo":"http://hikapro.com/system/backpack/items/photos/000/000/402/medium/PhoneCarCharger.jpg?1449419889","photo_thumb":"http://hikapro.com/system/backpack/items/photos/000/000/402/thumb/PhoneCarCharger.jpg?1449419889"},{"id":399,"item_category_id":11,"name":"Phone charger","description":"Always keep your phone charged, when there is such a chance.","buy_urls":[],"photo":"http://hikapro.com/system/backpack/items/photos/000/000/399/medium/PhoneCharger.jpg?1451153730","photo_thumb":"http://hikapro.com/system/backpack/items/photos/000/000/399/thumb/PhoneCharger.jpg?1451153730"},{"id":398,"item_category_id":11,"name":"Photo camera","description":"","buy_urls":[],"photo":"http://hikapro.com/system/backpack/items/photos/000/000/398/medium/PhotoCamera.jpeg?1453301166","photo_thumb":"http://hikapro.com/system/backpack/items/photos/000/000/398/thumb/PhotoCamera.jpeg?1453301166"},{"id":236,"item_category_id":8,"name":"Photocopies of documents","description":"Documents` copies will help you find a way out if originals are lost.","buy_urls":[],"photo":"http://hikapro.com/system/backpack/items/photos/000/000/236/medium/DocCopies.jpg?1451154129","photo_thumb":"http://hikapro.com/system/backpack/items/photos/000/000/236/thumb/DocCopies.jpg?1451154129"},{"id":364,"item_category_id":3,"name":"Pillow","description":"","buy_urls":["http://www.backcountry.com/Store/catalog/search.jsp?q=pillows\u0026s=a"],"photo":"http://hikapro.com/system/backpack/items/photos/000/000/364/medium/Pillow.jpg?1449419937","photo_thumb":"http://hikapro.com/system/backpack/items/photos/000/000/364/thumb/Pillow.jpg?1449419937"},{"id":339,"item_category_id":2,"name":"Plate","description":"","buy_urls":["http://www.backcountry.com/Store/catalog/search.jsp?q=plates\u0026s=a"],"photo":"http://hikapro.com/system/backpack/items/photos/000/000/339/medium/Plate.jpg?1449419993","photo_thumb":"http://hikapro.com/system/backpack/items/photos/000/000/339/thumb/Plate.jpg?1449419993"},{"id":248,"item_category_id":15,"name":"Pliers","description":"","buy_urls":["http://www.backcountry.com/Store/catalog/search.jsp?q=pliers\u0026s=a"],"photo":"http://hikapro.com/system/backpack/items/photos/000/000/248/medium/Pliers.jpg?1449420057","photo_thumb":"http://hikapro.com/system/backpack/items/photos/000/000/248/thumb/Pliers.jpg?1449420057"},{"id":216,"item_category_id":5,"name":"Pocket mirror","description":"Take care of yourself even while in the wilderness.","buy_urls":["https://en.wikipedia.org/wiki/Mirror"],"photo":"http://hikapro.com/system/backpack/items/photos/000/000/216/medium/PocketMirror.jpg?1451153812","photo_thumb":"http://hikapro.com/system/backpack/items/photos/000/000/216/thumb/PocketMirror.jpg?1451153812"},{"id":353,"item_category_id":3,"name":"Pocket trowel","description":"Designed to support the Leave No Trace ethic of minimizing backcountry impact by humans.","buy_urls":["http://www.backcountry.com/Store/catalog/search.jsp?q=pocket%20trowel\u0026s=a"],"photo":"http://hikapro.com/system/backpack/items/photos/000/000/353/medium/PocketShovel.jpg?1451154079","photo_thumb":"http://hikapro.com/system/backpack/items/photos/000/000/353/thumb/PocketShovel.jpg?1451154079"},{"id":403,"item_category_id":11,"name":"Powerbank","description":"","buy_urls":["http://www.backcountry.com/Store/catalog/search.jsp?q=power%20banks\u0026s=a"],"photo":"http://hikapro.com/system/backpack/items/photos/000/000/403/medium/Powerbank.jpg?1449420258","photo_thumb":"http://hikapro.com/system/backpack/items/photos/000/000/403/thumb/Powerbank.jpg?1449420258"},{"id":425,"item_category_id":3,"name":"Protection shorts","description":"","buy_urls":["http://www.backcountry.com/Store/catalog/search.jsp?q=protection%20shorts\u0026s=a"],"photo":"http://hikapro.com/system/backpack/items/photos/000/000/425/medium/ProtectionShorts.jpg?1452074534","photo_thumb":"http://hikapro.com/system/backpack/items/photos/000/000/425/thumb/ProtectionShorts.jpg?1452074534"},{"id":426,"item_category_id":3,"name":"Protective knee pads","description":"","buy_urls":["http://www.backcountry.com/Store/catalog/search.jsp?q=protection%20pads\u0026s=a"],"photo":"http://hikapro.com/system/backpack/items/photos/000/000/426/medium/ProtectionPads.jpg?1452074622","photo_thumb":"http://hikapro.com/system/backpack/items/photos/000/000/426/thumb/ProtectionPads.jpg?1452074622"},{"id":378,"item_category_id":3,"name":"Prusik","description":"","buy_urls":["http://www.backcountry.com/Store/catalog/search.jsp?q=prusik%20cords\u0026s=a"],"photo":"http://hikapro.com/system/backpack/items/photos/000/000/378/medium/Prusik.jpg?1449420360","photo_thumb":"http://hikapro.com/system/backpack/items/photos/000/000/378/thumb/Prusik.jpg?1449420360"},{"id":247,"item_category_id":15,"name":"Pump","description":"Recommended in every car trip.","buy_urls":[],"photo":"http://hikapro.com/system/backpack/items/photos/000/000/247/medium/Pump.jpg?1451154458","photo_thumb":"http://hikapro.com/system/backpack/items/photos/000/000/247/thumb/Pump.jpg?1451154458"},{"id":383,"item_category_id":3,"name":"Quickdraw with carabiners","description":"Suitable for all types of climbing. Select basing on strength abd weight.","buy_urls":["http://www.backcountry.com/Store/catalog/search.jsp?q=quickdraws\u0026s=a"],"photo":"http://hikapro.com/system/backpack/items/photos/000/000/383/medium/Quickdraw.jpg?1449420412","photo_thumb":"http://hikapro.com/system/backpack/items/photos/000/000/383/thumb/Quickdraw.jpg?1449420412"},{"id":413,"item_category_id":1,"name":"Raincoat","description":"Protects your clothes and backpack from rain.","buy_urls":["http://www.backcountry.com/Store/catalog/search.jsp?q=rain%20coats\u0026s=a"],"photo":"http://hikapro.com/system/backpack/items/photos/000/000/413/medium/Raincoat.jpg?1449420461","photo_thumb":"http://hikapro.com/system/backpack/items/photos/000/000/413/thumb/Raincoat.jpg?1449420461"},{"id":212,"item_category_id":5,"name":"Razor","description":"A razor is a bladed tool primarily used in the removal of unwanted body hair through the act of shaving","buy_urls":[],"photo":"http://hikapro.com/system/backpack/items/photos/000/000/212/medium/Razor.jpg?1451152785","photo_thumb":"http://hikapro.com/system/backpack/items/photos/000/000/212/thumb/Razor.jpg?1451152785"},{"id":276,"item_category_id":4,"name":"Respiratory and ENT infection medication","description":"Advise your doctor to get the right medicine prescribed.","buy_urls":["https://en.wikipedia.org/wiki/Broad-spectrum_antibiotic"],"photo":"http://hikapro.com/system/backpack/items/photos/000/000/276/medium/BroadSpectrum_Antibiotics.jpg?1452023125","photo_thumb":"http://hikapro.com/system/backpack/items/photos/000/000/276/thumb/BroadSpectrum_Antibiotics.jpg?1452023125"},{"id":348,"item_category_id":3,"name":"Rope","description":"Choose the rope depending on activity type and rope`s characteristics. Ropes for climbing and for clothes drying differ significantly.","buy_urls":["http://www.backcountry.com/Store/catalog/search.jsp?q=ropes\u0026s=a"],"photo":"http://hikapro.com/system/backpack/items/photos/000/000/348/medium/Rope.jpg?1449420527","photo_thumb":"http://hikapro.com/system/backpack/items/photos/000/000/348/thumb/Rope.jpg?1449420527"},{"id":255,"item_category_id":15,"name":"Saw","description":"","buy_urls":["http://www.backcountry.com/Store/catalog/search.jsp?q=saws\u0026s=a"],"photo":"http://hikapro.com/system/backpack/items/photos/000/000/255/medium/Saw.jpg?1449420564","photo_thumb":"http://hikapro.com/system/backpack/items/photos/000/000/255/thumb/Saw.jpg?1449420564"},{"id":379,"item_category_id":3,"name":"Screw-lock carabiner","description":"Keep in mind strength and weight parameters when selecting carabiners.","buy_urls":["http://www.backcountry.com/Store/catalog/search.jsp?q=screw-lock%20carabiners\u0026s=a"],"photo":"http://hikapro.com/system/backpack/items/photos/000/000/379/medium/ScrewLock-Carab.jpg?1449420611","photo_thumb":"http://hikapro.com/system/backpack/items/photos/000/000/379/thumb/ScrewLock-Carab.jpg?1449420611"},{"id":291,"item_category_id":4,"name":"Sedative","description":"Advise your doctor to get the right medicine prescribed.","buy_urls":["https://en.wikipedia.org/wiki/Sedative"],"photo":"http://hikapro.com/system/backpack/items/photos/000/000/291/medium/BroadSpectrum_Antibiotics.jpg?1452023651","photo_thumb":"http://hikapro.com/system/backpack/items/photos/000/000/291/thumb/BroadSpectrum_Antibiotics.jpg?1452023651"},{"id":262,"item_category_id":15,"name":"Sewing kit","description":"","buy_urls":["http://www.backcountry.com/Store/catalog/search.jsp?q=sewing%20kits\u0026s=a"],"photo":"http://hikapro.com/system/backpack/items/photos/000/000/262/medium/SewingKit.jpg?1449420716","photo_thumb":"http://hikapro.com/system/backpack/items/photos/000/000/262/thumb/SewingKit.jpg?1449420716"},{"id":231,"item_category_id":5,"name":"Shampoo","description":"","buy_urls":["http://www.backcountry.com/Store/catalog/search.jsp?q=shampoos\u0026s=a"],"photo":"http://hikapro.com/system/backpack/items/photos/000/000/231/medium/Shampoo.jpg?1449420759","photo_thumb":"http://hikapro.com/system/backpack/items/photos/000/000/231/thumb/Shampoo.jpg?1449420759"},{"id":328,"item_category_id":1,"name":"Shorts","description":"","buy_urls":["http://www.backcountry.com/Store/catalog/search.jsp?q=shorts\u0026s=a"],"photo":"http://hikapro.com/system/backpack/items/photos/000/000/328/medium/Shorts.jpg?1449420806","photo_thumb":"http://hikapro.com/system/backpack/items/photos/000/000/328/thumb/Shorts.jpg?1449420806"},{"id":264,"item_category_id":15,"name":"Shovel","description":"Helps in setting up a camp or freeing a stuck vehicle.","buy_urls":["http://www.backcountry.com/Store/catalog/search.jsp?q=shovel\u0026s=u"],"photo":"http://hikapro.com/system/backpack/items/photos/000/000/264/medium/Shovel.jpg?1449420842","photo_thumb":"http://hikapro.com/system/backpack/items/photos/000/000/264/thumb/Shovel.jpg?1449420842"},{"id":414,"item_category_id":3,"name":"Signal mirror","description":"Will help you give a signal and draw rescuers' attention.","buy_urls":["http://www.backcountry.com/Store/catalog/search.jsp?q=signal%20mirror\u0026s=a"],"photo":"http://hikapro.com/system/backpack/items/photos/000/000/414/medium/SugnalMirror.jpg?1449418739","photo_thumb":"http://hikapro.com/system/backpack/items/photos/000/000/414/thumb/SugnalMirror.jpg?1449418739"},{"id":408,"item_category_id":11,"name":"SIM card","description":"Simply, if I will be in a country for more than a day, I use a local SIM that I have used previously and can top-up online, or I purchase a SIM locally.","buy_urls":[],"photo":"http://hikapro.com/system/backpack/items/photos/000/000/408/medium/sim-card.jpg?1451143175","photo_thumb":"http://hikapro.com/system/backpack/items/photos/000/000/408/thumb/sim-card.jpg?1451143175"},{"id":359,"item_category_id":3,"name":"Sitting mat","description":"Make yourself confortable at camp and around a campfire.","buy_urls":["http://www.backcountry.com/Store/catalog/search.jsp?q=sitting%20chairs\u0026s=a"],"photo":"http://hikapro.com/system/backpack/items/photos/000/000/359/medium/SittingMat.jpg?1449420937","photo_thumb":"http://hikapro.com/system/backpack/items/photos/000/000/359/thumb/SittingMat.jpg?1449420937"},{"id":417,"item_category_id":3,"name":"Ski boots","description":"","buy_urls":["http://www.backcountry.com/Store/catalog/search.jsp?q=ski%20boots\u0026s=a"],"photo":"http://hikapro.com/system/backpack/items/photos/000/000/417/medium/SkiBoots.jpg?1452072909","photo_thumb":"http://hikapro.com/system/backpack/items/photos/000/000/417/thumb/SkiBoots.jpg?1452072909"},{"id":423,"item_category_id":3,"name":"Ski or snowboard bag","description":"","buy_urls":["http://www.backcountry.com/Store/catalog/search.jsp?q=ski%20bags\u0026s=a"],"photo":"http://hikapro.com/system/backpack/items/photos/000/000/423/medium/SkiBag.jpg?1452074311","photo_thumb":"http://hikapro.com/system/backpack/items/photos/000/000/423/thumb/SkiBag.jpg?1452074311"},{"id":418,"item_category_id":3,"name":"Ski poles","description":"","buy_urls":["http://www.backcountry.com/Store/catalog/search.jsp?q=ski%20poles\u0026s=a"],"photo":"http://hikapro.com/system/backpack/items/photos/000/000/418/medium/SkiPoles.jpg?1452072990","photo_thumb":"http://hikapro.com/system/backpack/items/photos/000/000/418/thumb/SkiPoles.jpg?1452072990"},{"id":357,"item_category_id":3,"name":"Skis","description":"Plan to take your own or rental skis, when you go skiing.\r\nIt is easier to move around on skis through deep snow in winter hike.","buy_urls":["http://www.backcountry.com/Store/catalog/search.jsp?q=skis\u0026s=a"],"photo":"http://hikapro.com/system/backpack/items/photos/000/000/357/medium/Skis.jpg?1449421032","photo_thumb":"http://hikapro.com/system/backpack/items/photos/000/000/357/thumb/Skis.jpg?1449421032"},{"id":368,"item_category_id":3,"name":"Sleeping bag","description":"Choose a sleeping bag taking into account your travel region's night temperatures.","buy_urls":["http://www.backcountry.com/Store/catalog/search.jsp?q=sleeping%20bags\u0026s=a"],"photo":"http://hikapro.com/system/backpack/items/photos/000/000/368/medium/SleepingBag.jpg?1449421080","photo_thumb":"http://hikapro.com/system/backpack/items/photos/000/000/368/thumb/SleepingBag.jpg?1449421080"},{"id":355,"item_category_id":3,"name":"Sleeping mat","description":"Choose a right pad for a comfortable and supportive sleep in expected temperature.","buy_urls":["http://www.backcountry.com/Store/catalog/search.jsp?q=sleeping%20mats\u0026s=a"],"photo":"http://hikapro.com/system/backpack/items/photos/000/000/355/medium/SleepingMat.jpg?1449421131","photo_thumb":"http://hikapro.com/system/backpack/items/photos/000/000/355/thumb/SleepingMat.jpg?1449421131"},{"id":415,"item_category_id":3,"name":"Snowboard","description":"","buy_urls":["http://www.backcountry.com/Store/catalog/search.jsp?q=snowboard\u0026s=a"],"photo":"http://hikapro.com/system/backpack/items/photos/000/000/415/medium/Snowboard.jpg?1452072704","photo_thumb":"http://hikapro.com/system/backpack/items/photos/000/000/415/thumb/Snowboard.jpg?1452072704"},{"id":416,"item_category_id":3,"name":"Snowboard boots","description":"","buy_urls":["http://www.backcountry.com/Store/catalog/search.jsp?q=snowboard%20boots\u0026s=a"],"photo":"http://hikapro.com/system/backpack/items/photos/000/000/416/medium/SnowboardBoots.jpg?1452072840","photo_thumb":"http://hikapro.com/system/backpack/items/photos/000/000/416/thumb/SnowboardBoots.jpg?1452072840"},{"id":310,"item_category_id":1,"name":"Socks","description":"It is important to have enough of comfortable socks, suitable for youe type of travel.","buy_urls":["http://www.backcountry.com/Store/catalog/search.jsp?q=socks\u0026s=a"],"photo":"http://hikapro.com/system/backpack/items/photos/000/000/310/medium/Socks.jpg?1449421194","photo_thumb":"http://hikapro.com/system/backpack/items/photos/000/000/310/thumb/Socks.jpg?1449421194"},{"id":337,"item_category_id":2,"name":"Spoon","description":"Better use spork.","buy_urls":["http://www.backcountry.com/Store/catalog/search.jsp?q=spoon%20fork%20knife\u0026s=a"],"photo":"http://hikapro.com/system/backpack/items/photos/000/000/337/medium/Spoon.jpg?1449421261","photo_thumb":"http://hikapro.com/system/backpack/items/photos/000/000/337/thumb/Spoon.jpg?1449421261"},{"id":278,"item_category_id":4,"name":"Sticking plasters","description":"A small medical dressing used for injuries not serious enough to require a full-size bandage.","buy_urls":["https://en.wikipedia.org/wiki/Adhesive_bandage"],"photo":"http://hikapro.com/system/backpack/items/photos/000/000/278/medium/StickingPlasters.jpg?1451154231","photo_thumb":"http://hikapro.com/system/backpack/items/photos/000/000/278/thumb/StickingPlasters.jpg?1451154231"},{"id":229,"item_category_id":5,"name":"Sunburn relief","description":"","buy_urls":[],"photo":"","photo_thumb":""},{"id":318,"item_category_id":1,"name":"Sunglasses","description":"","buy_urls":["http://www.backcountry.com/Store/catalog/search.jsp?q=sunglass\u0026s=a"],"photo":"http://hikapro.com/system/backpack/items/photos/000/000/318/medium/Sunglasses.jpg?1449421331","photo_thumb":"http://hikapro.com/system/backpack/items/photos/000/000/318/thumb/Sunglasses.jpg?1449421331"},{"id":227,"item_category_id":5,"name":"Sunscreen","description":"","buy_urls":["http://www.backcountry.com/Store/catalog/search.jsp?q=sunscreens\u0026s=a"],"photo":"http://hikapro.com/system/backpack/items/photos/000/000/227/medium/Sunscreen.jpg?1449421384","photo_thumb":"http://hikapro.com/system/backpack/items/photos/000/000/227/thumb/Sunscreen.jpg?1449421384"},{"id":304,"item_category_id":1,"name":"Swimsuit","description":"Pack it into your backpack if water treatment is expected.","buy_urls":["http://www.backcountry.com/Store/catalog/search.jsp?q=swimsuits\u0026s=a"],"photo":"http://hikapro.com/system/backpack/items/photos/000/000/304/medium/Swimsuite.jpg?1449422991","photo_thumb":"http://hikapro.com/system/backpack/items/photos/000/000/304/thumb/Swimsuite.jpg?1449422991"},{"id":252,"item_category_id":15,"name":"Synthetic packthread","description":"","buy_urls":[],"photo":"http://hikapro.com/system/backpack/items/photos/000/000/252/medium/Packthread.jpg?1452021018","photo_thumb":"http://hikapro.com/system/backpack/items/photos/000/000/252/thumb/Packthread.jpg?1452021018"},{"id":293,"item_category_id":14,"name":"Table","description":"","buy_urls":["http://www.backcountry.com/Store/catalog/search.jsp?q=tables\u0026s=a"],"photo":"http://hikapro.com/system/backpack/items/photos/000/000/293/medium/Table.jpg?1449423084","photo_thumb":"http://hikapro.com/system/backpack/items/photos/000/000/293/thumb/Table.jpg?1449423084"},{"id":261,"item_category_id":15,"name":"Tape","description":"","buy_urls":[],"photo":"http://hikapro.com/system/backpack/items/photos/000/000/261/medium/tape.jpeg?1453300044","photo_thumb":"http://hikapro.com/system/backpack/items/photos/000/000/261/thumb/tape.jpeg?1453300044"},{"id":363,"item_category_id":3,"name":"Tent","description":"Protects you and your stuff from wind, rain and sun. Choose a tend basing on weather conditions, type of travel and weight.","buy_urls":["http://www.backcountry.com/Store/catalog/search.jsp?q=tents\u0026s=a"],"photo":"http://hikapro.com/system/backpack/items/photos/000/000/363/medium/tent.jpg?1449423197","photo_thumb":"http://hikapro.com/system/backpack/items/photos/000/000/363/thumb/tent.jpg?1449423197"},{"id":259,"item_category_id":15,"name":"Tent repair kit","description":"","buy_urls":["http://www.backcountry.com/Store/catalog/search.jsp?q=tent%20repair%20accessories\u0026s=a"],"photo":"http://hikapro.com/system/backpack/items/photos/000/000/259/medium/TentRepair.jpg?1449423303","photo_thumb":"http://hikapro.com/system/backpack/items/photos/000/000/259/thumb/TentRepair.jpg?1449423303"},{"id":232,"item_category_id":8,"name":"Tickets","description":"Take care of the train, plane and bus tickets.","buy_urls":[],"photo":"http://hikapro.com/system/backpack/items/photos/000/000/232/medium/Tickets.jpg?1451152502","photo_thumb":"http://hikapro.com/system/backpack/items/photos/000/000/232/thumb/Tickets.jpg?1451152502"},{"id":344,"item_category_id":16,"name":"Tick repellent","description":"","buy_urls":["http://www.backcountry.com/Store/catalog/search.jsp?q=tick%20repellent\u0026s=a"],"photo":"http://hikapro.com/system/backpack/items/photos/000/000/344/medium/InsectsRepell.jpg?1449423339","photo_thumb":"http://hikapro.com/system/backpack/items/photos/000/000/344/thumb/InsectsRepell.jpg?1449423339"},{"id":230,"item_category_id":5,"name":"Toilet paper","description":"","buy_urls":[],"photo":"http://hikapro.com/system/backpack/items/photos/000/000/230/medium/ToiletPaper.jpeg?1453300806","photo_thumb":"http://hikapro.com/system/backpack/items/photos/000/000/230/thumb/ToiletPaper.jpeg?1453300806"},{"id":220,"item_category_id":5,"name":"Toilet soap","description":"Hygienic procedures are also useful to set the mood.","buy_urls":["https://en.wikipedia.org/wiki/Soap"],"photo":"http://hikapro.com/system/backpack/items/photos/000/000/220/medium/ToiletSoap.jpg?1451154324","photo_thumb":"http://hikapro.com/system/backpack/items/photos/000/000/220/thumb/ToiletSoap.jpg?1451154324"},{"id":218,"item_category_id":5,"name":"Toothbrush","description":"Most of the cleaning is achieved by the mechanical action of the toothbrush, and not by the toothpaste.","buy_urls":["https://en.wikipedia.org/wiki/Toothbrush"],"photo":"http://hikapro.com/system/backpack/items/photos/000/000/218/medium/ToothBrush.jpg?1451153915","photo_thumb":"http://hikapro.com/system/backpack/items/photos/000/000/218/thumb/ToothBrush.jpg?1451153915"},{"id":217,"item_category_id":5,"name":"Toothpaste","description":"Toothpaste is commonly used in conjunction with a toothbrush to increase the effectiveness of tooth brushing. ","buy_urls":["https://en.wikipedia.org/wiki/Toothpaste"],"photo":"http://hikapro.com/system/backpack/items/photos/000/000/217/medium/ToothPaste.jpg?1451153866","photo_thumb":"http://hikapro.com/system/backpack/items/photos/000/000/217/thumb/ToothPaste.jpg?1451153866"},{"id":219,"item_category_id":5,"name":"Toothpicks","description":"A toothpick is a small stick of wood, plastic, bamboo used to remove detritus from the teeth, usually after a meal.","buy_urls":["https://en.wikipedia.org/wiki/Toothpick"],"photo":"http://hikapro.com/system/backpack/items/photos/000/000/219/medium/ToothPicks.jpg?1451153973","photo_thumb":"http://hikapro.com/system/backpack/items/photos/000/000/219/thumb/ToothPicks.jpg?1451153973"},{"id":224,"item_category_id":5,"name":"Towel","description":"","buy_urls":["http://www.backcountry.com/Store/catalog/search.jsp?q=towels\u0026s=a"],"photo":"http://hikapro.com/system/backpack/items/photos/000/000/224/medium/Towel.jpg?1449423433","photo_thumb":"http://hikapro.com/system/backpack/items/photos/000/000/224/thumb/Towel.jpg?1449423433"},{"id":242,"item_category_id":15,"name":"Tow rope","description":"May come in handy either on the road, or in the forest, or, especially, in the muddy bogs.","buy_urls":[],"photo":"http://hikapro.com/system/backpack/items/photos/000/000/242/medium/TowRope.jpg?1451152830","photo_thumb":"http://hikapro.com/system/backpack/items/photos/000/000/242/thumb/TowRope.jpg?1451152830"},{"id":362,"item_category_id":3,"name":"Trash bags","description":"Help you leave no trail","buy_urls":["https://en.wikipedia.org/wiki/Bin_bag"],"photo":"http://hikapro.com/system/backpack/items/photos/000/000/362/medium/TrashBags.jpg?1452019443","photo_thumb":"http://hikapro.com/system/backpack/items/photos/000/000/362/thumb/TrashBags.jpg?1452019443"},{"id":372,"item_category_id":3,"name":"Trekking poles","description":"","buy_urls":["http://www.backcountry.com/Store/catalog/search.jsp?q=poles%20trekking\u0026s=a"],"photo":"http://hikapro.com/system/backpack/items/photos/000/000/372/medium/TrekkingPoles.jpg?1449423515","photo_thumb":"http://hikapro.com/system/backpack/items/photos/000/000/372/thumb/TrekkingPoles.jpg?1449423515"},{"id":327,"item_category_id":1,"name":"T-shirt","description":"","buy_urls":["http://www.backcountry.com/Store/catalog/search.jsp?q=t-shirts\u0026s=a"],"photo":"http://hikapro.com/system/backpack/items/photos/000/000/327/medium/TShirt.jpg?1449423554","photo_thumb":"http://hikapro.com/system/backpack/items/photos/000/000/327/thumb/TShirt.jpg?1449423554"},{"id":386,"item_category_id":3,"name":"Tubular belay device","description":"","buy_urls":["http://www.backcountry.com/Store/catalog/search.jsp?q=belay%20devices\u0026s=a"],"photo":"http://hikapro.com/system/backpack/items/photos/000/000/386/medium/TubularBelay.jpg?1449423606","photo_thumb":"http://hikapro.com/system/backpack/items/photos/000/000/386/thumb/TubularBelay.jpg?1449423606"},{"id":410,"item_category_id":5,"name":"Tweezers","description":"","buy_urls":["http://www.backcountry.com/Store/catalog/search.jsp?q=tweezers\u0026s=a"],"photo":"http://hikapro.com/system/backpack/items/photos/000/000/410/medium/Tweezers.jpg?1449423637","photo_thumb":"http://hikapro.com/system/backpack/items/photos/000/000/410/thumb/Tweezers.jpg?1449423637"},{"id":309,"item_category_id":1,"name":"Underwear","description":"Choose comfortable underwear for the selected type of adventure and according to weather conditions.","buy_urls":["http://www.backcountry.com/Store/catalog/search.jsp?q=underwear\u0026s=a"],"photo":"http://hikapro.com/system/backpack/items/photos/000/000/309/medium/Underwear.jpg?1449423701","photo_thumb":"http://hikapro.com/system/backpack/items/photos/000/000/309/thumb/Underwear.jpg?1449423701"},{"id":340,"item_category_id":2,"name":"Vacuum flask","description":"","buy_urls":["http://www.backcountry.com/Store/catalog/search.jsp?q=vacuum%20flasks\u0026s=a"],"photo":"http://hikapro.com/system/backpack/items/photos/000/000/340/medium/VacuumFlask.jpg?1449423741","photo_thumb":"http://hikapro.com/system/backpack/items/photos/000/000/340/thumb/VacuumFlask.jpg?1449423741"},{"id":240,"item_category_id":8,"name":"Vehicle registration certificate","description":"","buy_urls":[],"photo":"","photo_thumb":""},{"id":302,"item_category_id":1,"name":"Vest","description":"For the additional warmth you need when you are running, cycling, climbing, skiing, hiking, or camping.","buy_urls":["http://www.backcountry.com/Store/catalog/search.jsp?q=vests\u0026s=a"],"photo":"http://hikapro.com/system/backpack/items/photos/000/000/302/medium/Vest.jpg?1449423799","photo_thumb":"http://hikapro.com/system/backpack/items/photos/000/000/302/thumb/Vest.jpg?1449423799"},{"id":320,"item_category_id":1,"name":"Warm fleece hoodie","description":"","buy_urls":["http://www.backcountry.com/Store/catalog/search.jsp?q=warm%20hoodie\u0026s=a"],"photo":"http://hikapro.com/system/backpack/items/photos/000/000/320/medium/WarmFleeceHoodie.jpg?1449423855","photo_thumb":"http://hikapro.com/system/backpack/items/photos/000/000/320/thumb/WarmFleeceHoodie.jpg?1449423855"},{"id":322,"item_category_id":1,"name":"Warm gloves","description":"","buy_urls":["http://www.backcountry.com/Store/catalog/search.jsp?q=warm%20gloves\u0026s=a"],"photo":"http://hikapro.com/system/backpack/items/photos/000/000/322/medium/WarmGloves.jpg?1449423903","photo_thumb":"http://hikapro.com/system/backpack/items/photos/000/000/322/thumb/WarmGloves.jpg?1449423903"},{"id":321,"item_category_id":1,"name":"Warm socks","description":"","buy_urls":["http://www.backcountry.com/Store/catalog/search.jsp?q=warm%20socks\u0026s=a"],"photo":"http://hikapro.com/system/backpack/items/photos/000/000/321/medium/WarmSocks.jpg?1449424006","photo_thumb":"http://hikapro.com/system/backpack/items/photos/000/000/321/thumb/WarmSocks.jpg?1449424006"},{"id":374,"item_category_id":3,"name":"Watch","description":"","buy_urls":["http://www.backcountry.com/Store/catalog/search.jsp?q=watches\u0026s=a"],"photo":"http://hikapro.com/system/backpack/items/photos/000/000/374/medium/Watch.jpg?1449423966","photo_thumb":"http://hikapro.com/system/backpack/items/photos/000/000/374/thumb/Watch.jpg?1449423966"},{"id":332,"item_category_id":2,"name":"Water bottle","description":"Every time you leave a camp you should have it filled with water and at hand.","buy_urls":["http://www.backcountry.com/Store/catalog/search.jsp?q=water%20bottles\u0026s=a"],"photo":"http://hikapro.com/system/backpack/items/photos/000/000/332/medium/WaterBottle.jpg?1449424063","photo_thumb":"http://hikapro.com/system/backpack/items/photos/000/000/332/thumb/WaterBottle.jpg?1449424063"},{"id":373,"item_category_id":3,"name":"Water filter","description":"","buy_urls":["http://www.backcountry.com/Store/catalog/search.jsp?q=water%20filters\u0026s=a"],"photo":"http://hikapro.com/system/backpack/items/photos/000/000/373/medium/WaterFilter.jpg?1449424175","photo_thumb":"http://hikapro.com/system/backpack/items/photos/000/000/373/thumb/WaterFilter.jpg?1449424175"},{"id":350,"item_category_id":3,"name":"Waterproof bag","description":"Provides you a safe and dry place to keep your clothes, sleeping bag and documents in dry and protect them from rain or river water.","buy_urls":["http://www.backcountry.com/Store/catalog/search.jsp?q=waterproof%20bags\u0026s=a"],"photo":"http://hikapro.com/system/backpack/items/photos/000/000/350/medium/WaterproofBag.jpg?1449424229","photo_thumb":"http://hikapro.com/system/backpack/items/photos/000/000/350/thumb/WaterproofBag.jpg?1449424229"},{"id":234,"item_category_id":8,"name":"Waterproof bag for docs, cash, phone","description":"Always keep you documents, money, tickets and useful notes in dry and waterproof storage.","buy_urls":["http://www.backcountry.com/Store/catalog/search.jsp?q=document%20holder\u0026s=a"],"photo":"http://hikapro.com/system/backpack/items/photos/000/000/234/medium/WaterProofDocs.jpg?1449424384","photo_thumb":"http://hikapro.com/system/backpack/items/photos/000/000/234/thumb/WaterProofDocs.jpg?1449424384"},{"id":303,"item_category_id":1,"name":"Water suit","description":"Saves your warmth and protects your body during caving trips.","buy_urls":["http://www.backcountry.com/Store/catalog/search.jsp?q=water+suits\u0026s=u"],"photo":"http://hikapro.com/system/backpack/items/photos/000/000/303/medium/WaterSuite.jpg?1449417617","photo_thumb":"http://hikapro.com/system/backpack/items/photos/000/000/303/thumb/WaterSuite.jpg?1449417617"},{"id":214,"item_category_id":5,"name":"Wet wipes","description":"As a personal hygiene item, may be used during walks, at camp and on the road.","buy_urls":["https://en.wikipedia.org/wiki/Wet_wipe"],"photo":"http://hikapro.com/system/backpack/items/photos/000/000/214/medium/WetWipes.jpg?1451153038","photo_thumb":"http://hikapro.com/system/backpack/items/photos/000/000/214/thumb/WetWipes.jpg?1451153038"},{"id":367,"item_category_id":3,"name":"Whistle","description":"Will help you give a signal to your friends or rescuers.","buy_urls":["http://www.backcountry.com/Store/catalog/search.jsp?q=whistles\u0026s=a"],"photo":"http://hikapro.com/system/backpack/items/photos/000/000/367/medium/Whistle.jpg?1449424449","photo_thumb":"http://hikapro.com/system/backpack/items/photos/000/000/367/thumb/Whistle.jpg?1449424449"},{"id":330,"item_category_id":1,"name":"Windbreaker","description":"Recommended even in summer hikes, when it is easy to catch cold on the light wind being warmed up after a walk.","buy_urls":["http://www.backcountry.com/Store/catalog/search.jsp?q=windbreakers\u0026s=a"],"photo":"http://hikapro.com/system/backpack/items/photos/000/000/330/medium/Windbreaker.jpg?1449424538","photo_thumb":"http://hikapro.com/system/backpack/items/photos/000/000/330/thumb/Windbreaker.jpg?1449424538"},{"id":297,"item_category_id":1,"name":"Winter Buff","description":"May be used as a hat, scarf, bandana, head or wrist band.","buy_urls":["http://www.backcountry.com/Store/catalog/search.jsp?q=winter%20buff\u0026s=a"],"photo":"http://hikapro.com/system/backpack/items/photos/000/000/297/medium/WinterBuff.jpg?1449424586","photo_thumb":"http://hikapro.com/system/backpack/items/photos/000/000/297/thumb/WinterBuff.jpg?1449424586"},{"id":308,"item_category_id":1,"name":"Winter jacket","description":"Will save your warmth during winter and alpine hikes.","buy_urls":["http://www.backcountry.com/Store/catalog/search.jsp?q=winter%20jackets\u0026s=a"],"photo":"http://hikapro.com/system/backpack/items/photos/000/000/308/medium/WinterJacket.jpg?1449424641","photo_thumb":"http://hikapro.com/system/backpack/items/photos/000/000/308/thumb/WinterJacket.jpg?1449424641"},{"id":419,"item_category_id":3,"name":"Winter sports gloves","description":"","buy_urls":["http://www.backcountry.com/Store/catalog/search.jsp?q=ski%20gloves\u0026s=a"],"photo":"http://hikapro.com/system/backpack/items/photos/000/000/419/medium/WinterSportsGloves.jpg?1452073787","photo_thumb":"http://hikapro.com/system/backpack/items/photos/000/000/419/thumb/WinterSportsGloves.jpg?1452073787"},{"id":421,"item_category_id":1,"name":"Winter sports jacket","description":"","buy_urls":["http://www.backcountry.com/Store/catalog/search.jsp?q=ski%20jackets\u0026s=a"],"photo":"http://hikapro.com/system/backpack/items/photos/000/000/421/medium/WinterSportsJacket.jpg?1452074023","photo_thumb":"http://hikapro.com/system/backpack/items/photos/000/000/421/thumb/WinterSportsJacket.jpg?1452074023"},{"id":420,"item_category_id":1,"name":"Winter sports pants","description":"","buy_urls":["http://www.backcountry.com/Store/catalog/search.jsp?q=ski%20pants\u0026s=a"],"photo":"http://hikapro.com/system/backpack/items/photos/000/000/420/medium/WinterSportsPants.jpg?1452073933","photo_thumb":"http://hikapro.com/system/backpack/items/photos/000/000/420/thumb/WinterSportsPants.jpg?1452073933"},{"id":256,"item_category_id":15,"name":"Wire","description":"","buy_urls":["http://www.backcountry.com/Store/catalog/search.jsp?q=wire\u0026s=a"],"photo":"http://hikapro.com/system/backpack/items/photos/000/000/256/medium/Wire.jpg?1449424699","photo_thumb":"http://hikapro.com/system/backpack/items/photos/000/000/256/thumb/Wire.jpg?1449424699"},{"id":388,"item_category_id":3,"name":"Wire rope","description":"","buy_urls":[],"photo":"http://hikapro.com/system/backpack/items/photos/000/000/388/medium/WireRope.jpeg?1453300739","photo_thumb":"http://hikapro.com/system/backpack/items/photos/000/000/388/thumb/WireRope.jpeg?1453300739"},{"id":253,"item_category_id":15,"name":"Work gloves","description":"","buy_urls":["http://www.backcountry.com/Store/catalog/search.jsp?q=work%20gloves\u0026s=a"],"photo":"http://hikapro.com/system/backpack/items/photos/000/000/253/medium/ExtraWorkGloves.jpg?1449424764","photo_thumb":"http://hikapro.com/system/backpack/items/photos/000/000/253/thumb/ExtraWorkGloves.jpg?1449424764"},{"id":285,"item_category_id":4,"name":"Wound gel/spray","description":"Advise your doctor to get the right medicine prescribed.","buy_urls":[],"photo":"http://hikapro.com/system/backpack/items/photos/000/000/285/medium/WoundSpray.jpg?1452020159","photo_thumb":"http://hikapro.com/system/backpack/items/photos/000/000/285/thumb/WoundSpray.jpg?1452020159"},{"id":246,"item_category_id":15,"name":"Wrench set","description":"In autotravel small repairs may be required at any time, be prepared for it.","buy_urls":["http://www.backcountry.com/Store/catalog/search.jsp?q=wrench%20set\u0026s=a"],"photo":"http://hikapro.com/system/backpack/items/photos/000/000/246/medium/WrenchSet.jpg?1449424813","photo_thumb":"http://hikapro.com/system/backpack/items/photos/000/000/246/thumb/WrenchSet.jpg?1449424813"},{"id":427,"item_category_id":3,"name":"Wrist guards","description":"","buy_urls":["http://www.backcountry.com/Store/catalog/search.jsp?q=wrist%20guards\u0026s=a"],"photo":"http://hikapro.com/system/backpack/items/photos/000/000/427/medium/WristGuards.jpg?1452074745","photo_thumb":"http://hikapro.com/system/backpack/items/photos/000/000/427/thumb/WristGuards.jpg?1452074745"}] \ No newline at end of file diff --git a/app/src/main/assets/jsons/sets.json b/app/src/main/assets/jsons/sets.json new file mode 100644 index 0000000..afc170e --- /dev/null +++ b/app/src/main/assets/jsons/sets.json @@ -0,0 +1 @@ +[{"id":4,"item_ids":[212,213,214,215,216,217,218,219,220,221,222,223,224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,239,254,256,258,259,261,253,257,262,270,275,296,295,297,300,298,308,306,309,310,311,313,318,319,320,321,322,315,323,325,326,327,329,331,333,335,336,337,338,339,340,341,377,348,349,351,352,391,379,353,380,355,381,382,383,358,360,361,362,363,378,384,365,366,367,385,368,386,369,387,371,372,388,374,394,403,395,400,397,398],"name":"Alpine","photo":"","photo_thumb":"","photo_thumbnail":""},{"id":5,"item_ids":[212,213,214,216,217,218,220,221,222,224,225,226,227,228,229,230,231,233,235,236,237,238,239,240,241,242,249,250,243,244,264,251,245,246,247,255,248,256,252,261,253,293,294,299,304,305,309,310,312,317,318,327,328,329,331,333,334,335,336,337,338,343,339,341,342,344,345,346,347,348,353,355,359,362,363,364,368,369,370,374,394,402,400,401,398,258,259,262,275,270,406,223,215,409,232,411,412],"name":"Caravanning","photo":"","photo_thumb":"","photo_thumbnail":""},{"id":8,"item_ids":[212,213,214,215,216,217,218,219,220,221,222,223,224,225,226,228,230,231,232,233,234,235,236,237,238,239,254,256,258,259,260,261,253,257,262,270,275,299,303,305,306,309,310,311,312,314,316,317,321,315,327,328,329,331,332,333,334,335,336,337,338,343,339,340,341,342,344,345,346,377,389,390,348,349,352,379,353,380,383,358,392,362,363,364,378,384,365,366,367,368,386,369,387,370,371,388,373,374,403,395,391,396,400,397,398],"name":"Caving","photo":"","photo_thumb":"","photo_thumbnail":""},{"id":3,"item_ids":[279,282,273,274,288,283,291,289,271,267,268,269,270,266,278,286,277,272,280,281,265,284,285,287,276,290,292],"name":"First-aid kit","photo":"","photo_thumb":"","photo_thumbnail":""},{"id":15,"item_ids":[],"name":"My list","photo":"","photo_thumb":"","photo_thumbnail":""},{"id":2,"item_ids":[212,213,214,215,216,217,218,219,220,221,222,223,224,225,226,227,228,229,230,231,232,233,234,235,238,249,264,254,255,258,259,252,261,253,262,270,275,299,303,304,306,309,310,311,312,316,317,318,327,328,329,331,332,333,334,335,336,337,338,343,339,340,341,342,344,345,346,375,347,348,350,353,359,362,363,364,365,367,368,376,369,370,374,403,395,400,397,398],"name":"Rafting","photo":"","photo_thumb":"","photo_thumbnail":""},{"id":14,"item_ids":[409,217,218,224,225,227,232,234,235,238,254,275,292,295,296,297,421,306,309,310,311,317,318,315,323,327,329,420,332,340,416,427,424,426,425,380,357,417,418,422,419,415,423,374,408,405,404,400,401,428],"name":"Ski / Snowboard","photo":"","photo_thumb":"","photo_thumbnail":""},{"id":1,"item_ids":[212,213,214,215,216,217,218,219,220,221,222,223,224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,239,254,256,258,259,261,253,262,270,275,296,299,304,330,306,309,310,311,312,316,317,318,320,321,325,326,327,328,329,331,332,333,334,335,336,337,338,343,339,341,342,344,345,346,347,348,349,352,353,354,355,356,360,361,362,363,364,365,367,368,369,370,372,373,374,394,403,395,400,397,398,413],"name":"Summer hiking","photo":"","photo_thumb":"","photo_thumbnail":""},{"id":6,"item_ids":[212,213,214,215,216,217,218,219,220,222,224,225,226,228,231,232,233,235,236,237,238,239,275,299,305,309,310,311,317,318,325,326,327,328,329,332,374,399,400,401,393,398,405,404,340],"name":"Trip","photo":"","photo_thumb":"","photo_thumbnail":""},{"id":10,"item_ids":[223,214,215,409,217,218,219,220,224,225,226,230,234,235,239,264,261,253,270,275,295,297,300,298,308,309,310,311,313,318,320,321,315,324,326,329,332,333,335,336,337,338,339,340,341,331,349,352,353,354,355,356,357,361,362,363,364,365,366,367,368,369,372,374,394,408,395,400,397],"name":"Winter hiking","photo":"","photo_thumb":"","photo_thumbnail":""}] \ No newline at end of file diff --git a/app/src/main/java/com/hikapro/backpack/App.java b/app/src/main/java/com/hikapro/backpack/App.java index c2fd994..5ca45f6 100644 --- a/app/src/main/java/com/hikapro/backpack/App.java +++ b/app/src/main/java/com/hikapro/backpack/App.java @@ -2,6 +2,7 @@ package com.hikapro.backpack; import android.app.Application; import android.content.Context; +import android.graphics.Typeface; /** * Created by tariel on 27/04/16. @@ -9,14 +10,20 @@ import android.content.Context; public class App extends Application { private static Context context; + private static Typeface mainFace; @Override public void onCreate() { super.onCreate(); App.context = getApplicationContext(); + App.mainFace = Typeface.createFromAsset(App.context.getAssets(), "fonts/Ubuntu-B.ttf"); } public static Context getAppContext() { return App.context; } + + public static Typeface getMainFace() { + return App.mainFace; + } } diff --git a/app/src/main/java/com/hikapro/backpack/model/ItemModel.java b/app/src/main/java/com/hikapro/backpack/model/ItemModel.java index efeed30..b437c46 100644 --- a/app/src/main/java/com/hikapro/backpack/model/ItemModel.java +++ b/app/src/main/java/com/hikapro/backpack/model/ItemModel.java @@ -74,7 +74,17 @@ public class ItemModel implements Model.Item { break; case Event.ITEM_CATEGORY_LOAD_ERROR : break; - case Event.SET_ITEMS_LOAD_COMPLETED : + case Event.SET_ITEMS_LIKE_ERROR: + if (!itemsCache.isEmpty()) { + itemsCache.clear(); + } + notifyDataSetChanged(); + break; + case Event.SET_ITEMS_LOAD_COMPLETED: + itemsCache = (List) event.obj; + notifyDataSetChanged(); + break; + case Event.SET_ITEMS_LIKE_COMPLETED: itemsCache = (List) event.obj; notifyDataSetChanged(); break; @@ -96,10 +106,7 @@ public class ItemModel implements Model.Item { notifyDataSetChanged(); break; case Event.SET_UNPACK_COMPLETED: - packedQty = 0; - if (presenter != null) { - presenter.notifyItemPackStatusChanged(); - } + executeQuery(); break; case Event.ITEM_CATEGORY_LOAD_COMPLETED: categoriesCache = (Hashtable)event.obj; @@ -117,10 +124,8 @@ public class ItemModel implements Model.Item { break; case Event.ITEM_INSERTED : break; - case Event.SET_RESTORE_COMPLETED : - if (presenter != null) { - presenter.notifyDataSetChanged(); - } + case Event.SET_RESTORE_COMPLETED: + executeQuery(); Toast.makeText(App.getAppContext(), "Restore completed", Toast.LENGTH_SHORT).show(); break; } @@ -192,16 +197,11 @@ public class ItemModel implements Model.Item { command.arg1 = presenter.getCurrentSet().getId(); dao.executeCommand(command); } else { - query = query.toLowerCase(); - String name; - List newList = new ArrayList<>(20); - for (Item item : itemsCache) { - name = item.getName().toLowerCase(); - if (name.contains(query)) { - newList.add(item); - } - } - itemsCache = newList; + Message command = Message.obtain(); + command.what = Command.SET_GET_ITEMS_LIKE; + command.arg1 = presenter.getCurrentSet().getId(); + command.obj = query; + dao.executeCommand(command); } } @@ -285,7 +285,6 @@ public class ItemModel implements Model.Item { //itemsCache.remove(item); } } -// TODO use item itself? @Override public void packItem(com.hikapro.backpack.model.entities.Item item) { if (item != null) { @@ -305,7 +304,11 @@ public class ItemModel implements Model.Item { @Override public void unpackSet(int setId) { - // nothing + Message command; + command = Message.obtain(); + command.what = Command.SET_UNPACK_ITEMS; + command.arg1 = setId; + dao.executeCommand(command); } @Override diff --git a/app/src/main/java/com/hikapro/backpack/model/PackedModel.java b/app/src/main/java/com/hikapro/backpack/model/PackedModel.java index 584e1ec..62f8beb 100644 --- a/app/src/main/java/com/hikapro/backpack/model/PackedModel.java +++ b/app/src/main/java/com/hikapro/backpack/model/PackedModel.java @@ -1,11 +1,13 @@ package com.hikapro.backpack.model; import android.os.Message; +import android.widget.Toast; import java.util.Collections; import java.util.Hashtable; import java.util.List; +import com.hikapro.backpack.App; import com.hikapro.backpack.model.dao.Command; import com.hikapro.backpack.model.dao.Event; import com.hikapro.backpack.model.entities.Category; @@ -40,6 +42,23 @@ public class PackedModel extends ItemModel { dao.executeCommand(command); } + @Override + public void filter(String query) { + + if (query.isEmpty()) { + Message command = Message.obtain(); + command.what = Command.SET_GET_PACKED_ITEMS; + command.arg1 = presenter.getCurrentSet().getId(); + dao.executeCommand(command); + } else { + Message command = Message.obtain(); + command.what = Command.SET_GET_ITEMS_LIKE_PACKED; + command.arg1 = presenter.getCurrentSet().getId(); + command.obj = query; + dao.executeCommand(command); + } + } + @Override public void onEvent(Message event) { @@ -61,10 +80,20 @@ public class PackedModel extends ItemModel { break; case Event.ITEM_REMOVAL_CANCEL_ERROR: break; + case Event.SET_ITEMS_LIKE_PACKED_ERROR: + if (!itemsCache.isEmpty()) { + itemsCache.clear(); + } + notifyDataSetChanged(); + break; case Event.SET_PACKED_LOAD_COMPLETED : itemsCache = (List) event.obj; notifyDataSetChanged(); break; + case Event.SET_ITEMS_LIKE_PACKED_COMPLETED: + itemsCache = (List) event.obj; + notifyDataSetChanged(); + break; case Event.SET_GET_STAT_COMPLETED: currentSetActiveItemsQty = event.arg1; packedQty = event.arg2; @@ -86,11 +115,7 @@ public class PackedModel extends ItemModel { notifyDataSetChanged(); break; case Event.SET_UNPACK_COMPLETED : - packedQty = 0; - itemsCache.clear(); - if (presenter != null) { - presenter.notifyItemPackStatusChanged(); - } + executeQuery(); break; case Event.ITEM_CATEGORY_LOAD_COMPLETED : categoriesCache = (Hashtable)event.obj; @@ -101,6 +126,10 @@ public class PackedModel extends ItemModel { case Event.ITEM_UNPACKED : executeQuery(); break; + case Event.SET_RESTORE_COMPLETED: + executeQuery(); + Toast.makeText(App.getAppContext(), "Restore completed", Toast.LENGTH_SHORT).show(); + break; } } @@ -127,13 +156,4 @@ public class PackedModel extends ItemModel { itemsCache.remove(item); } } - - @Override - public void unpackSet(int setId) { - Message command; - command = Message.obtain(); - command.what = Command.SET_UNPACK_ITEMS; - command.arg1 = setId; - dao.executeCommand(command); - } } diff --git a/app/src/main/java/com/hikapro/backpack/model/SetModel.java b/app/src/main/java/com/hikapro/backpack/model/SetModel.java index aadb3eb..53f62df 100644 --- a/app/src/main/java/com/hikapro/backpack/model/SetModel.java +++ b/app/src/main/java/com/hikapro/backpack/model/SetModel.java @@ -93,6 +93,12 @@ public class SetModel implements Model.Set { if (presenter != null) presenter.stopProgress(); Toast.makeText(App.getAppContext(), R.string.no_connection, Toast.LENGTH_SHORT).show(); + Message command = Message.obtain(); + command.what = Command.SYNC_READ_FROM_FILE; + dao.executeCommand(command); + command = Message.obtain(); + command.what = Command.SET_GET_ALL; + dao.executeCommand(command); break; case Event.SYNC_FAILED : if (presenter != null) diff --git a/app/src/main/java/com/hikapro/backpack/model/dao/Command.java b/app/src/main/java/com/hikapro/backpack/model/dao/Command.java index e57a994..71ee94a 100644 --- a/app/src/main/java/com/hikapro/backpack/model/dao/Command.java +++ b/app/src/main/java/com/hikapro/backpack/model/dao/Command.java @@ -18,6 +18,8 @@ public interface Command { int SET_RESTORE_DEFAULT = 0x69; int SET_GET_STAT = 0x70; int SET_CLEAN_PACKED = 0x71; + int SET_GET_ITEMS_LIKE = 0x72; + int SET_GET_ITEMS_LIKE_PACKED = 0x73; int ITEM_DELETE_FROM_SET = 0x78; int ITEM_INSERT = 0x79; @@ -37,6 +39,7 @@ public interface Command { int SYNC = 0xA0; int SYNC_IF_NOT_EXISTS = 0xA1; + int SYNC_READ_FROM_FILE = 0xA2; int TEST = 0xC8; diff --git a/app/src/main/java/com/hikapro/backpack/model/dao/DAO.java b/app/src/main/java/com/hikapro/backpack/model/dao/DAO.java index 8207094..3eb79c0 100644 --- a/app/src/main/java/com/hikapro/backpack/model/dao/DAO.java +++ b/app/src/main/java/com/hikapro/backpack/model/dao/DAO.java @@ -12,8 +12,11 @@ import android.os.Looper; import android.os.Message; import android.os.Process; import android.text.TextUtils; +import android.util.Log; import java.io.IOException; +import java.io.InputStream; +import java.lang.reflect.Type; import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; @@ -26,6 +29,8 @@ import java.util.concurrent.LinkedBlockingQueue; import java.util.concurrent.ThreadPoolExecutor; import java.util.concurrent.TimeUnit; +import com.google.gson.Gson; +import com.google.gson.reflect.TypeToken; import com.hikapro.backpack.App; import com.hikapro.backpack.model.Api; import com.hikapro.backpack.model.Model; @@ -122,26 +127,34 @@ public class DAO { if (command != null) { switch (command.what) { - case Command.SET_GET_ALL : + case Command.SET_GET_ALL: setTask = new SetTask(Command.SET_GET_ALL, Process.THREAD_PRIORITY_MORE_FAVORABLE); threadPool.execute(setTask); break; - case Command.SET_REORDER : + case Command.SET_REORDER: setTask = new SetTask(Command.SET_REORDER, Process.THREAD_PRIORITY_BACKGROUND); setTask.setsToUpdate = (List) command.obj; threadPool.execute(setTask); break; - case Command.SET_GET_ITEMS : + case Command.SET_GET_ITEMS: setTask = new SetTask(Command.SET_GET_ITEMS, Process.THREAD_PRIORITY_MORE_FAVORABLE); setTask.setId = command.arg1; threadPool.execute(setTask); break; + case Command.SET_GET_ITEMS_LIKE: + setTask = new SetTask(Command.SET_GET_ITEMS_LIKE, + Process.THREAD_PRIORITY_MORE_FAVORABLE); + setTask.setId = command.arg1; + setTask.query = (String) command.obj; + threadPool.execute(setTask); + break; + case Command.SET_GET_PACKED_ITEMS : setTask = new SetTask(Command.SET_GET_PACKED_ITEMS, Process.THREAD_PRIORITY_MORE_FAVORABLE); @@ -149,41 +162,49 @@ public class DAO { threadPool.execute(setTask); break; - case Command.SET_UNPACK_ITEMS : + case Command.SET_GET_ITEMS_LIKE_PACKED: + setTask = new SetTask(Command.SET_GET_ITEMS_LIKE_PACKED, + Process.THREAD_PRIORITY_MORE_FAVORABLE); + setTask.setId = command.arg1; + setTask.query = (String) command.obj; + threadPool.execute(setTask); + break; + + case Command.SET_UNPACK_ITEMS: setTask = new SetTask(Command.SET_UNPACK_ITEMS, Process.THREAD_PRIORITY_DEFAULT); setTask.setId = command.arg1; threadPool.execute(setTask); break; - case Command.SET_RESTORE_DEFAULT : + case Command.SET_RESTORE_DEFAULT: setTask = new SetTask(Command.SET_RESTORE_DEFAULT, Process.THREAD_PRIORITY_DEFAULT); setTask.setId = command.arg1; threadPool.execute(setTask); break; - case Command.SET_GET_STAT : + case Command.SET_GET_STAT: setTask = new SetTask(Command.SET_GET_STAT, Process.THREAD_PRIORITY_MORE_FAVORABLE); setTask.setId = command.arg1; threadPool.execute(setTask); break; - case Command.SET_CLEAN_PACKED : + case Command.SET_CLEAN_PACKED: setTask = new SetTask(Command.SET_CLEAN_PACKED, Process.THREAD_PRIORITY_MORE_FAVORABLE); setTask.setId = command.arg1; threadPool.execute(setTask); break; - case Command.ITEM_GET_CATEGORIES : + case Command.ITEM_GET_CATEGORIES: itemTask = new ItemTask(Command.ITEM_GET_CATEGORIES, Process.THREAD_PRIORITY_MORE_FAVORABLE); threadPool.execute(itemTask); break; - case Command.ITEM_INSERT : + case Command.ITEM_INSERT: itemTask = new ItemTask(Command.ITEM_INSERT, Process.THREAD_PRIORITY_BACKGROUND); itemTask.item = (Item) command.obj; @@ -199,7 +220,7 @@ public class DAO { threadPool.execute(itemTask); break; - case Command.ITEM_DELETE_FROM_SET : + case Command.ITEM_DELETE_FROM_SET: itemTask = new ItemTask(Command.ITEM_DELETE_FROM_SET, Process.THREAD_PRIORITY_BACKGROUND); itemTask.setId = command.arg1; @@ -269,12 +290,17 @@ public class DAO { case Command.MY_LIST_CLEAR : break; - case Command.SYNC : + case Command.SYNC: threadPool.execute(new SyncTask(Command.SYNC, Process.THREAD_PRIORITY_BACKGROUND)); break; - case Command.SYNC_IF_NOT_EXISTS : + case Command.SYNC_READ_FROM_FILE: + threadPool.execute(new SyncTask(Command.SYNC_READ_FROM_FILE, + Process.THREAD_PRIORITY_BACKGROUND)); + break; + + case Command.SYNC_IF_NOT_EXISTS: threadPool.execute(new SyncTask(Command.SYNC_IF_NOT_EXISTS, Process.THREAD_PRIORITY_MORE_FAVORABLE)); break; @@ -436,18 +462,20 @@ public class DAO { } } - private void insertSetItem(int setId, int itemId, boolean userDefined) { + private long insertSetItem(int setId, int itemId, boolean userDefined) { + long ret = 0; ContentValues values; SQLiteDatabase db = getWriteDB(); try { db.beginTransaction(); values = Db.SetItemsTable.toContentValues(setId, itemId, userDefined); - db.insert(Db.SetItemsTable.TABLE_NAME, null, values); + ret = db.insert(Db.SetItemsTable.TABLE_NAME, null, values); db.setTransactionSuccessful(); } finally { db.endTransaction(); db.close(); } + return ret; } // reads @@ -637,9 +665,11 @@ public class DAO { } } catch (SQLiteException e) { //TODO write to log here + ret = null; } catch (Exception e) { //TODO write to log here + ret = null; } finally { if (cursor != null) cursor.close(); @@ -680,6 +710,61 @@ public class DAO { return ret; } + private List readItemsLike(String like, int setId, boolean packed) { + List ret = new ArrayList<>(256); + Cursor cursor = null; + SQLiteDatabase db = null; + Item item; + String query = String.format( + "SELECT a.%s, a.%s, a.%s, a.%s, a.%s, a.%s, a.%s, a.%s, a.%s, a.%s, %s, %s FROM %s a INNER JOIN %s b ON a.%s = b.%s WHERE b.%s = ? AND a.%s LIKE %s AND b.%s <> 1 AND b.%s %s 1", + + Db.ItemsTable.COLUMN_ID, + Db.ItemsTable.COLUMN_NAME, + Db.ItemsTable.COLUMN_CATEGORY, + Db.ItemsTable.COLUMN_DESCRIPTION, + Db.ItemsTable.COLUMN_BUY_URLS, + Db.ItemsTable.COLUMN_PHOTO_URL, + Db.ItemsTable.COLUMN_PHOTO_THUMB_URL, + Db.ItemsTable.COLUMN_PHOTO_LOCAL, + Db.ItemsTable.COLUMN_PHOTO_THUMB_LOCAL, + Db.ItemsTable.COLUMN_USER_DEFINED, + Db.SetItemsTable.COLUMN_PENDING_REMOVAL, + Db.SetItemsTable.COLUMN_PACKED, + + Db.ItemsTable.TABLE_NAME, + Db.SetItemsTable.TABLE_NAME, + Db.ItemsTable.COLUMN_ID, + Db.SetItemsTable.COLUMN_ITEM, + Db.SetItemsTable.COLUMN_SET, + Db.ItemsTable.COLUMN_NAME, + '\''+like+'%'+'\'', + Db.SetItemsTable.COLUMN_DELETED, + Db.SetItemsTable.COLUMN_PACKED, + packed ? "=" : "<>"); + try { + db = getReadDB(); + cursor = db.rawQuery(query, new String[]{String.valueOf(setId)}); + while (cursor.moveToNext()) { + item = Db.ItemsTable.parseCursor(cursor); +// if (!packed && item.isPendingRemoval()) +// continue; + ret.add(item); + } + } catch (SQLiteException e) { + //TODO write to log here + ret = null; + } catch (Exception e) { + //TODO write to log here + ret = null; + } finally { + if (cursor != null) + cursor.close(); + if (db != null) + db.close(); + } + return ret; + } + private List readItemsLike(String like, int checkThisSet) { List ret = new ArrayList<>(256); Cursor cursor = null; @@ -960,6 +1045,40 @@ public class DAO { return ret; } + private int updateSetActiveQty(int setId, int updateOn) { + int ret = 0; + SQLiteDatabase db = null; + ContentValues values; + Set set; + try { + db = getWriteDB(); + db.beginTransaction(); + set = readSet(db, setId); + if (set != null) { + values = new ContentValues(); + + values.put(Db.SetsTable.COLUMN_ACTIVE_QTY, set.getActiveQty()+updateOn); + + ret += db.update(Db.SetsTable.TABLE_NAME, values, String.format("%s = ?", + Db.SetsTable.COLUMN_ID), + new String[]{String.valueOf(setId)}); + } + db.setTransactionSuccessful(); + } catch (SQLiteException e) { + //TODO write to log here + ret = -1; + } catch (Exception e) { + //TODO write to log here + ret = -1; + } finally { + if (db != null) { + db.endTransaction(); + db.close(); + } + } + return ret; + } + private int updateSetItemsCleanPacked(int setId) { int ret = 0; SQLiteDatabase db = null; @@ -1014,9 +1133,11 @@ public class DAO { db.setTransactionSuccessful(); } catch (SQLiteException e) { //TODO write to log here + ret = -1; } catch (Exception e) { //TODO write to log here + ret = -1; } finally { if (db != null) { db.endTransaction(); @@ -1065,7 +1186,6 @@ public class DAO { db.setTransactionSuccessful(); } catch (SQLiteException e) { //TODO write to log here - } catch (Exception e) { //TODO write to log here } finally { @@ -1099,6 +1219,7 @@ public class DAO { if (set != null) { values = new ContentValues(); values.put(Db.SetsTable.COLUMN_PACKED_QTY, 0); + values.put(Db.SetsTable.COLUMN_ACTIVE_QTY, set.getItems().size()); ret += db.update(Db.SetsTable.TABLE_NAME, values, String.format("%s = ?", Db.SetsTable.COLUMN_ID), new String[]{String.valueOf(setId)}); @@ -1109,9 +1230,10 @@ public class DAO { db.setTransactionSuccessful(); } catch (SQLiteException e) { //TODO write to log here - + ret = -1; } catch (Exception e) { //TODO write to log here + ret = -1; } finally { if (db != null) { db.endTransaction(); @@ -1331,10 +1453,12 @@ public class DAO { case Command.ITEM_INSERT : if (insertItem(item) > 0) { - insertSetItem(setId, item.getId(), item.isUserDefined()); - message.what = Event.ITEM_INSERTED; - message.arg1 = setId; - message.arg2 = item.getId(); + if (insertSetItem(setId, item.getId(), item.isUserDefined()) > 0) { + updateSetActiveQty(setId, 1); + message.what = Event.ITEM_INSERTED; + message.arg1 = setId; + message.arg2 = item.getId(); + } } else { message.what = Event.ITEM_INSERT_ERROR; } @@ -1388,6 +1512,7 @@ public class DAO { int currentCommand; int priority; int setId; + String query; List setsToUpdate; List items; @@ -1404,7 +1529,7 @@ public class DAO { Message message = Message.obtain(); switch (currentCommand) { - case Command.SET_GET_ALL : + case Command.SET_GET_ALL: List sets = readSets(); if (sets.isEmpty()) message.what = Event.SET_LOAD_ERROR; @@ -1414,9 +1539,9 @@ public class DAO { } break; - case Command.SET_GET_ITEMS : + case Command.SET_GET_ITEMS: items = readItems(setId, false); - if (items.isEmpty()) + if (items == null) message.what = Event.SET_ITEMS_LOAD_ERROR; else { Collections.sort(items); @@ -1426,7 +1551,19 @@ public class DAO { } break; - case Command.SET_REORDER : + case Command.SET_GET_ITEMS_LIKE: + items = readItemsLike(query, setId, false); + if (items == null) + message.what = Event.SET_ITEMS_LIKE_ERROR; + else { + Collections.sort(items); + message.what = Event.SET_ITEMS_LIKE_COMPLETED; + message.obj = items; + message.arg1 = setId; + } + break; + + case Command.SET_REORDER: message.arg1 = updateSetsOrder(setsToUpdate); if (message.arg1 > 0) message.what = Event.SET_REORDER_COMPLETED; @@ -1436,7 +1573,7 @@ public class DAO { case Command.SET_GET_PACKED_ITEMS : items = readItems(setId, true); - if (items.isEmpty()) + if (items == null) message.what = Event.SET_PACKED_LOAD_ERROR; else { Collections.sort(items); @@ -1446,6 +1583,18 @@ public class DAO { } break; + case Command.SET_GET_ITEMS_LIKE_PACKED: + items = readItemsLike(query, setId, true); + if (items == null) + message.what = Event.SET_ITEMS_LIKE_PACKED_ERROR; + else { + Collections.sort(items); + message.what = Event.SET_ITEMS_LIKE_PACKED_COMPLETED; + message.obj = items; + message.arg1 = setId; + } + break; + case Command.SET_UNPACK_ITEMS : message.arg1 = updateSetItemsPacked(setId, false); message.arg2 = setId; @@ -1524,7 +1673,7 @@ public class DAO { } } - } else { + } else { // for the first time if (!NetworkUtil.isInternetAvailable()) { message.what = Event.SYNC_NO_CONNECTION; } else { @@ -1553,6 +1702,41 @@ public class DAO { } break; + case Command.SYNC_READ_FROM_FILE: + + try { + String sets = readSetsFromFile(); + String categories = readCategoriesFromFile(); + String items = readItemsFromFile(); + + if (sets != null && categories != null && items != null) { + Gson gson = new Gson(); + Type type = new TypeToken>() { + }.getType(); + List setsFromJson = gson.fromJson(sets, type); + insertSets(setsFromJson); + type = new TypeToken>() { + }.getType(); + List categoriesFromJson = gson.fromJson(categories, type); + insertCategories(categoriesFromJson); + type = new TypeToken>() { + }.getType(); + List itemsFromJson = gson.fromJson(items, type); + insertItems(itemsFromJson); + insertTimestamp(new Timestamp(1456083374)); + message.what = Event.SYNC_COMPLETED; + } else { + message.what = Event.SYNC_FAILED; + } + } catch (Exception ex) { + Log.e("Read from file", ex.getMessage()); + message.what = Event.SYNC_FAILED; + } finally { + message.arg1 = 200; + handler.sendMessage(message); + } + break; + case Command.SYNC_IF_NOT_EXISTS: if (logExist()) { message.what = Event.SYNC_COMPLETED; @@ -1649,5 +1833,48 @@ public class DAO { return bitmap; } + private String readSetsFromFile() { + String sets = null; + try { + InputStream is = App.getAppContext().getAssets().open("jsons/sets.json"); + int size = is.available(); + byte[] buffer = new byte[size]; + is.read(buffer); + is.close(); + sets = new String(buffer, "UTF-8"); + } catch (IOException ex) { + Log.e("Reading json", ex.getMessage()); + } + return sets; + } + private String readCategoriesFromFile() { + String categories = null; + try { + InputStream is = App.getAppContext().getAssets().open("jsons/item_categories.json"); + int size = is.available(); + byte[] buffer = new byte[size]; + is.read(buffer); + is.close(); + categories = new String(buffer, "UTF-8"); + } catch (IOException ex) { + Log.e("Reading json", ex.getMessage()); + } + return categories; + } + + private String readItemsFromFile() { + String items = null; + try { + InputStream is = App.getAppContext().getAssets().open("jsons/items.json"); + int size = is.available(); + byte[] buffer = new byte[size]; + is.read(buffer); + is.close(); + items = new String(buffer, "UTF-8"); + } catch (IOException ex) { + Log.e("Reading json", ex.getMessage()); + } + return items; + } } diff --git a/app/src/main/java/com/hikapro/backpack/model/dao/Event.java b/app/src/main/java/com/hikapro/backpack/model/dao/Event.java index 8cc5c70..99490a2 100644 --- a/app/src/main/java/com/hikapro/backpack/model/dao/Event.java +++ b/app/src/main/java/com/hikapro/backpack/model/dao/Event.java @@ -5,10 +5,6 @@ package com.hikapro.backpack.model.dao; */ public interface Event { - int SET_SCOPE_END = 0x13; - int ITEM_SCOPE_END = 0x27; - int MY_LIST_SCOPE_END = 0x3B; - int SET_LOAD_ERROR = -0x1; int SET_REORDER_ERROR = -0x2; int SET_ITEMS_LOAD_ERROR = -0x3; @@ -17,6 +13,8 @@ public interface Event { int SET_RESTORE_ERROR = -0x6; int SET_GET_STAT_ERROR = -0x7; int SET_CLEAN_PACKED_ERROR = -0x8; + int SET_ITEMS_LIKE_ERROR = -0x9; + int SET_ITEMS_LIKE_PACKED_ERROR = -0xA; int SET_LOAD_COMPLETED = 0x1; @@ -27,6 +25,8 @@ public interface Event { int SET_RESTORE_COMPLETED = 0x6; int SET_GET_STAT_COMPLETED = 0x7; int SET_PACKED_CLEANED = 0x8; + int SET_ITEMS_LIKE_COMPLETED = 0x9; + int SET_ITEMS_LIKE_PACKED_COMPLETED = 0xA; int ITEM_FROM_SET_ERROR = -0x14; int ITEM_INSERT_ERROR = -0x15; diff --git a/app/src/main/java/com/hikapro/backpack/model/entities/Timestamp.java b/app/src/main/java/com/hikapro/backpack/model/entities/Timestamp.java index a958966..bccb418 100644 --- a/app/src/main/java/com/hikapro/backpack/model/entities/Timestamp.java +++ b/app/src/main/java/com/hikapro/backpack/model/entities/Timestamp.java @@ -15,6 +15,10 @@ public class Timestamp { public Timestamp() { } + public Timestamp(long value) { + this.timestamp = value; + } + } diff --git a/app/src/main/java/com/hikapro/backpack/presenter/AddPresenter.java b/app/src/main/java/com/hikapro/backpack/presenter/AddPresenter.java index ce5f535..2e9c1f6 100644 --- a/app/src/main/java/com/hikapro/backpack/presenter/AddPresenter.java +++ b/app/src/main/java/com/hikapro/backpack/presenter/AddPresenter.java @@ -98,7 +98,7 @@ public class AddPresenter implements Presenter.Add { recycler.setAdapter(adapter); recycler.setItemAnimator(new DefaultItemAnimator()); //recycler.addItemDecoration(new DividerDecoration(getActivityContext())); - recycler.addItemDecoration(new DividerDecoration2(getActivityContext(), R.drawable.divider, Util.dp2px(getAppContext(), 16))); + recycler.addItemDecoration(new DividerDecoration2(getActivityContext(), R.drawable.divider2, Util.dp2px(getAppContext(), 16))); categoryContainer = (FlowLayout) view.findViewById(R.id.add_item_category_flow); //categoryContainer.setPaddings(Util.dp2px(getAppContext(), 15), Util.dp2px(getAppContext(), 15)); // TODO check here categoryContainerMain = (ViewGroup) view.findViewById(R.id.add_item_category_container); diff --git a/app/src/main/java/com/hikapro/backpack/presenter/ItemListPresenter.java b/app/src/main/java/com/hikapro/backpack/presenter/ItemListPresenter.java index 90f43a3..2126992 100644 --- a/app/src/main/java/com/hikapro/backpack/presenter/ItemListPresenter.java +++ b/app/src/main/java/com/hikapro/backpack/presenter/ItemListPresenter.java @@ -155,7 +155,6 @@ public class ItemListPresenter implements Presenter.ItemList { } - private void showPackedItems () { getView().showPackedItems(set); } @@ -173,6 +172,7 @@ public class ItemListPresenter implements Presenter.ItemList { this.view = new WeakReference<>(view); this.set = getView().getSet(); } + @Override public void setModel(Model.Item model) { this.model = model; @@ -191,6 +191,7 @@ public class ItemListPresenter implements Presenter.ItemList { return null; } } + @Override public Context getActivityContext() { try { diff --git a/app/src/main/java/com/hikapro/backpack/presenter/PackedListPresenter.java b/app/src/main/java/com/hikapro/backpack/presenter/PackedListPresenter.java index f388692..e21d8e2 100644 --- a/app/src/main/java/com/hikapro/backpack/presenter/PackedListPresenter.java +++ b/app/src/main/java/com/hikapro/backpack/presenter/PackedListPresenter.java @@ -16,7 +16,9 @@ import android.widget.TextView; import com.hikapro.backpack.R; import com.hikapro.backpack.model.entities.Set; import com.hikapro.backpack.presenter.adapters.PackedListAdapter; +import com.hikapro.backpack.presenter.adapters.helper.Util; import com.hikapro.backpack.presenter.adapters.helper.items.DividerDecoration; +import com.hikapro.backpack.presenter.adapters.helper.items.DividerDecoration2; import com.hikapro.backpack.presenter.adapters.helper.items.ItemSwipeCallback; import com.hikapro.backpack.presenter.adapters.helper.items.StickyHeaderDecoration; @@ -49,7 +51,8 @@ public class PackedListPresenter extends ItemListPresenter { final StickyHeaderDecoration decoration = new StickyHeaderDecoration(adapter); recycler.addItemDecoration(decoration); - recycler.addItemDecoration(new DividerDecoration(getActivityContext())); + //recycler.addItemDecoration(new DividerDecoration(getActivityContext())); + recycler.addItemDecoration(new DividerDecoration2(getActivityContext(), R.drawable.divider, Util.dp2px(getAppContext(), 16))); adapter.registerAdapterDataObserver(new RecyclerView.AdapterDataObserver() { @Override public void onChanged() { @@ -63,18 +66,7 @@ public class PackedListPresenter extends ItemListPresenter { backToList = (TextView) view.findViewById(R.id.back_to_list); packedCount = (TextView) view.findViewById(R.id.header_packed_count); unpackButton = (Button) view.findViewById(R.id.unpack_button); -/* - if (model.getPackedQty() == model.getActiveItemsCount()) { - backToList.setVisibility(View.INVISIBLE); - packedCount.setVisibility(View.INVISIBLE); - unpackButton.setVisibility(View.VISIBLE); - } else { - backToList.setVisibility(View.VISIBLE); - packedCount.setVisibility(View.VISIBLE); - unpackButton.setVisibility(View.INVISIBLE); - } -*/ setVisibility(); unpackButton.setOnClickListener(new View.OnClickListener() { @Override diff --git a/app/src/main/java/com/hikapro/backpack/presenter/SharePresenter.java b/app/src/main/java/com/hikapro/backpack/presenter/SharePresenter.java index 4c9268e..56fb14e 100644 --- a/app/src/main/java/com/hikapro/backpack/presenter/SharePresenter.java +++ b/app/src/main/java/com/hikapro/backpack/presenter/SharePresenter.java @@ -7,6 +7,7 @@ import android.os.Bundle; import android.view.LayoutInflater; import android.view.ViewGroup; import android.widget.Button; +import android.widget.Toast; import com.facebook.CallbackManager; import com.facebook.FacebookCallback; @@ -122,6 +123,13 @@ public class SharePresenter implements Presenter.Share { } } }); + twitterButton.setOnClickListener(new android.view.View.OnClickListener() { + @Override + public void onClick(android.view.View v) { + Toast.makeText(getActivityContext(), "Not implemented!", Toast.LENGTH_SHORT).show(); + } + }); + return v; } diff --git a/app/src/main/java/com/hikapro/backpack/presenter/adapters/ItemDetailAdapter.java b/app/src/main/java/com/hikapro/backpack/presenter/adapters/ItemDetailAdapter.java index 7db6003..bdd65f0 100644 --- a/app/src/main/java/com/hikapro/backpack/presenter/adapters/ItemDetailAdapter.java +++ b/app/src/main/java/com/hikapro/backpack/presenter/adapters/ItemDetailAdapter.java @@ -1,11 +1,13 @@ package com.hikapro.backpack.presenter.adapters; +import android.content.res.Resources; import android.graphics.Color; import android.graphics.Paint; import android.support.v7.widget.RecyclerView; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; +import android.widget.CheckBox; import android.widget.LinearLayout; import com.hikapro.backpack.R; @@ -61,7 +63,7 @@ public class ItemDetailAdapter extends RecyclerView.Adapter { }); - SwipeMenuLayout menuLayout = (SwipeMenuLayout)holder.menu; + final SwipeMenuLayout menuLayout = (SwipeMenuLayout)holder.menu; SwipeMenu menu = new SwipeMenu(presenter.getActivityContext()); menuLayout.removeAllViews(); @@ -120,12 +122,9 @@ public class ItemDetailAdapter extends RecyclerView.Adapter { menu.addMenuItem(returnToListItem); } - menuLayout.addMenu(menu); - - menuLayout.setMenuItemClickListener(new SwipeMenuLayout.OnMenuItemClickListener() { + View.OnClickListener onClickListener = new View.OnClickListener() { @Override - public void onMenuItemClick(View v) { - + public void onClick(View v) { switch (v.getId()) { case ItemListAdapter.ID_DELETE: // no delete @@ -140,8 +139,10 @@ public class ItemDetailAdapter extends RecyclerView.Adapter { pack(item); break; } + menuLayout.notifyOnMenuItemClick(); } - }); + }; + menuLayout.addMenu(menu, onClickListener); } @Override diff --git a/app/src/main/java/com/hikapro/backpack/presenter/adapters/ItemListAdapter.java b/app/src/main/java/com/hikapro/backpack/presenter/adapters/ItemListAdapter.java index 03b9d1f..86ecd6d 100644 --- a/app/src/main/java/com/hikapro/backpack/presenter/adapters/ItemListAdapter.java +++ b/app/src/main/java/com/hikapro/backpack/presenter/adapters/ItemListAdapter.java @@ -8,7 +8,9 @@ import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.LinearLayout; +import android.widget.Toast; +import com.hikapro.backpack.App; import com.hikapro.backpack.R; import com.hikapro.backpack.model.entities.Category; import com.hikapro.backpack.model.entities.Item; @@ -34,7 +36,6 @@ public class ItemListAdapter extends RecyclerView.Adapter implem protected Presenter.ItemList presenter; protected boolean checkAll; - protected Typeface mainFace; public ItemListAdapter(Presenter.ItemList presenter) { this.presenter = presenter; @@ -84,8 +85,8 @@ public class ItemListAdapter extends RecyclerView.Adapter implem } }); - SwipeMenuLayout menuLayout = (SwipeMenuLayout)holder.menu; - SwipeMenu menu = new SwipeMenu(presenter.getActivityContext()); + final SwipeMenuLayout menuLayout = (SwipeMenuLayout)holder.menu; + final SwipeMenu menu = new SwipeMenu(presenter.getActivityContext()); menuLayout.removeAllViews(); @@ -160,12 +161,9 @@ public class ItemListAdapter extends RecyclerView.Adapter implem // add to menu menu.addMenuItem(deleteItem); - menuLayout.addMenu(menu); - - menuLayout.setMenuItemClickListener(new SwipeMenuLayout.OnMenuItemClickListener() { + View.OnClickListener onClickListener = new View.OnClickListener() { @Override - public void onMenuItemClick(View v) { - + public void onClick(View v) { switch (v.getId()) { case ID_DELETE: remove(item); @@ -180,9 +178,12 @@ public class ItemListAdapter extends RecyclerView.Adapter implem pack(item); break; } + menuLayout.notifyOnMenuItemClick(); } - }); + }; + + menuLayout.addMenu(menu, onClickListener); } @@ -229,6 +230,7 @@ public class ItemListAdapter extends RecyclerView.Adapter implem Category category = presenter.getModel().getCategoryByPosition(position); holder.id = category.getId(); holder.title.setText(category.getName()); + holder.title.setTypeface(App.getMainFace()); holder.title.setBackgroundColor(0x2B1E15); } @@ -245,18 +247,13 @@ public class ItemListAdapter extends RecyclerView.Adapter implem } public void pack(Item item) { - presenter.getModel().packItem(item); - //notifyDataSetChanged(); // TODO check nn - /* - notifyItemRemoved(position); - notifyItemRangeRemoved(position, getItemCount()); - */ + if (!item.isPacked()) + presenter.getModel().packItem(item); } public void unpack(Item item) { - presenter.getModel().unpackItem(item); - //notifyItemRemoved(position); - //notifyDataSetChanged(); // TODO check nn + if (item.isPacked()) + presenter.getModel().unpackItem(item); } public void setCheckAll(boolean checkAll) { diff --git a/app/src/main/java/com/hikapro/backpack/presenter/adapters/PackedListAdapter.java b/app/src/main/java/com/hikapro/backpack/presenter/adapters/PackedListAdapter.java index bbf7d21..935bbe6 100644 --- a/app/src/main/java/com/hikapro/backpack/presenter/adapters/PackedListAdapter.java +++ b/app/src/main/java/com/hikapro/backpack/presenter/adapters/PackedListAdapter.java @@ -54,7 +54,7 @@ public class PackedListAdapter extends ItemListAdapter { } }); - SwipeMenuLayout menuLayout = (SwipeMenuLayout)holder.menu; + final SwipeMenuLayout menuLayout = (SwipeMenuLayout)holder.menu; SwipeMenu menu = new SwipeMenu(presenter.getActivityContext()); menuLayout.removeAllViews(); @@ -130,12 +130,9 @@ public class PackedListAdapter extends ItemListAdapter { // add to menu menu.addMenuItem(deleteItem); - menuLayout.addMenu(menu); - - menuLayout.setMenuItemClickListener(new SwipeMenuLayout.OnMenuItemClickListener() { + View.OnClickListener onClickListener = new View.OnClickListener() { @Override - public void onMenuItemClick(View v) { - + public void onClick(View v) { switch (v.getId()) { case ID_DELETE: remove(item); @@ -150,8 +147,11 @@ public class PackedListAdapter extends ItemListAdapter { pack(item); break; } + menuLayout.notifyOnMenuItemClick(); } - }); + }; + + menuLayout.addMenu(menu, onClickListener); } @Override diff --git a/app/src/main/java/com/hikapro/backpack/presenter/adapters/SetListAdapter.java b/app/src/main/java/com/hikapro/backpack/presenter/adapters/SetListAdapter.java index bfa7f9d..c0c26d1 100644 --- a/app/src/main/java/com/hikapro/backpack/presenter/adapters/SetListAdapter.java +++ b/app/src/main/java/com/hikapro/backpack/presenter/adapters/SetListAdapter.java @@ -6,6 +6,7 @@ import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; +import com.hikapro.backpack.App; import com.hikapro.backpack.R; import com.hikapro.backpack.presenter.SetListPresenter; import com.hikapro.backpack.presenter.adapters.helper.sets.ItemTouchHelperAdapter; @@ -18,7 +19,6 @@ public class SetListAdapter extends RecyclerView.Adapter impleme private SetListPresenter presenter; private String rightBracket; - private Typeface mainFace; public SetListAdapter(SetListPresenter presenter) { this.presenter = presenter; @@ -38,13 +38,8 @@ public class SetListAdapter extends RecyclerView.Adapter impleme this.rightBracket = ""; } - if (mainFace == null) { - mainFace = Typeface.createFromAsset(presenter.getAppContext().getAssets(), - "fonts/Ubuntu-B.ttf"); - } - holder.textView.setText(set.getName() + " " + rightBracket); - holder.textView.setTypeface(mainFace); + holder.textView.setTypeface(App.getMainFace()); String info = String.format("%s %d / %d", presenter.getActivityContext().getResources().getString(R.string.packed), set.getPackedQty(), diff --git a/app/src/main/java/com/hikapro/backpack/presenter/adapters/helper/AutoResizeTextView.java b/app/src/main/java/com/hikapro/backpack/presenter/adapters/helper/AutoResizeTextView.java new file mode 100644 index 0000000..dbf43e7 --- /dev/null +++ b/app/src/main/java/com/hikapro/backpack/presenter/adapters/helper/AutoResizeTextView.java @@ -0,0 +1,296 @@ +package com.hikapro.backpack.presenter.adapters.helper; + +import android.annotation.TargetApi; +import android.content.Context; +import android.content.res.Resources; +import android.graphics.RectF; +import android.os.Build; +import android.text.Layout.Alignment; +import android.text.StaticLayout; +import android.text.TextPaint; +import android.util.AttributeSet; +import android.util.SparseIntArray; +import android.util.TypedValue; +import android.widget.TextView; + +public class AutoResizeTextView extends TextView { + private interface SizeTester { + /** + * + * @param suggestedSize + * Size of text to be tested + * @param availableSpace + * available space in which text must fit + * @return an integer < 0 if after applying {@code suggestedSize} to + * text, it takes less space than {@code availableSpace}, > 0 + * otherwise + */ + public int onTestSize(int suggestedSize, RectF availableSpace); + } + + private RectF mTextRect = new RectF(); + + private RectF mAvailableSpaceRect; + + private SparseIntArray mTextCachedSizes; + + private TextPaint mPaint; + + private float mMaxTextSize; + + private float mSpacingMult = 1.0f; + + private float mSpacingAdd = 0.0f; + + private float mMinTextSize = 20; + + private int mWidthLimit; + + private static final int NO_LINE_LIMIT = -1; + private int mMaxLines; + + private boolean mEnableSizeCache = true; + private boolean mInitiallized; + + public AutoResizeTextView(Context context) { + super(context); + initialize(); + } + + public AutoResizeTextView(Context context, AttributeSet attrs) { + super(context, attrs); + initialize(); + } + + public AutoResizeTextView(Context context, AttributeSet attrs, int defStyle) { + super(context, attrs, defStyle); + initialize(); + } + + private void initialize() { + mPaint = new TextPaint(getPaint()); + mMaxTextSize = getTextSize(); + mAvailableSpaceRect = new RectF(); + mTextCachedSizes = new SparseIntArray(); + if (mMaxLines == 0) { + // no value was assigned during construction + mMaxLines = NO_LINE_LIMIT; + } + mInitiallized = true; + } + + @Override + public void setText(final CharSequence text, BufferType type) { + super.setText(text, type); + adjustTextSize(text.toString()); + } + + @Override + public void setTextSize(float size) { + mMaxTextSize = size; + mTextCachedSizes.clear(); + adjustTextSize(getText().toString()); + } + + @Override + public void setMaxLines(int maxlines) { + super.setMaxLines(maxlines); + mMaxLines = maxlines; + reAdjust(); + } + + public int getMaxLines() { + return mMaxLines; + } + + @Override + public void setSingleLine() { + super.setSingleLine(); + mMaxLines = 1; + reAdjust(); + } + + @Override + public void setSingleLine(boolean singleLine) { + super.setSingleLine(singleLine); + if (singleLine) { + mMaxLines = 1; + } else { + mMaxLines = NO_LINE_LIMIT; + } + reAdjust(); + } + + @Override + public void setLines(int lines) { + super.setLines(lines); + mMaxLines = lines; + reAdjust(); + } + + @Override + public void setTextSize(int unit, float size) { + Context c = getContext(); + Resources r; + + if (c == null) + r = Resources.getSystem(); + else + r = c.getResources(); + mMaxTextSize = TypedValue.applyDimension(unit, size, + r.getDisplayMetrics()); + mTextCachedSizes.clear(); + adjustTextSize(getText().toString()); + } + + @Override + public void setLineSpacing(float add, float mult) { + super.setLineSpacing(add, mult); + mSpacingMult = mult; + mSpacingAdd = add; + } + + /** + * Set the lower text size limit and invalidate the view + * + * @param minTextSize + */ + public void setMinTextSize(float minTextSize) { + mMinTextSize = minTextSize; + reAdjust(); + } + + private void reAdjust() { + adjustTextSize(getText().toString()); + } + + private void adjustTextSize(String string) { + if (!mInitiallized) { + return; + } + int startSize = (int) mMinTextSize; + int heightLimit = getMeasuredHeight() - getCompoundPaddingBottom() + - getCompoundPaddingTop(); + mWidthLimit = getMeasuredWidth() - getCompoundPaddingLeft() + - getCompoundPaddingRight(); + mAvailableSpaceRect.right = mWidthLimit; + mAvailableSpaceRect.bottom = heightLimit; + super.setTextSize( + TypedValue.COMPLEX_UNIT_PX, + efficientTextSizeSearch(startSize, (int) mMaxTextSize, + mSizeTester, mAvailableSpaceRect)); + } + + private final SizeTester mSizeTester = new SizeTester() { + @TargetApi(Build.VERSION_CODES.JELLY_BEAN) + @Override + public int onTestSize(int suggestedSize, RectF availableSPace) { + mPaint.setTextSize(suggestedSize); + String text = getText().toString(); + boolean singleline = getMaxLines() == 1; + if (singleline) { + mTextRect.bottom = mPaint.getFontSpacing(); + mTextRect.right = mPaint.measureText(text); + } else { + StaticLayout layout = new StaticLayout(text, mPaint, + mWidthLimit, Alignment.ALIGN_NORMAL, mSpacingMult, + mSpacingAdd, true); + // return early if we have more lines + if (getMaxLines() != NO_LINE_LIMIT + && layout.getLineCount() > getMaxLines()) { + return 1; + } + mTextRect.bottom = layout.getHeight(); + int maxWidth = -1; + for (int i = 0; i < layout.getLineCount(); i++) { + if (maxWidth < layout.getLineWidth(i)) { + maxWidth = (int) layout.getLineWidth(i); + } + } + mTextRect.right = maxWidth; + } + + mTextRect.offsetTo(0, 0); + if (availableSPace.contains(mTextRect)) { + // may be too small, don't worry we will find the best match + return -1; + } else { + // too big + return 1; + } + } + }; + + /** + * Enables or disables size caching, enabling it will improve performance + * where you are animating a value inside TextView. This stores the font + * size against getText().length() Be careful though while enabling it as 0 + * takes more space than 1 on some fonts and so on. + * + * @param enable + * enable font size caching + */ + public void enableSizeCache(boolean enable) { + mEnableSizeCache = enable; + mTextCachedSizes.clear(); + adjustTextSize(getText().toString()); + } + + private int efficientTextSizeSearch(int start, int end, + SizeTester sizeTester, RectF availableSpace) { + if (!mEnableSizeCache) { + return binarySearch(start, end, sizeTester, availableSpace); + } + String text = getText().toString(); + int key = text == null ? 0 : text.length(); + int size = mTextCachedSizes.get(key); + if (size != 0) { + return size; + } + size = binarySearch(start, end, sizeTester, availableSpace); + mTextCachedSizes.put(key, size); + return size; + } + + private static int binarySearch(int start, int end, SizeTester sizeTester, + RectF availableSpace) { + int lastBest = start; + int lo = start; + int hi = end - 1; + int mid = 0; + while (lo <= hi) { + mid = (lo + hi) >>> 1; + int midValCmp = sizeTester.onTestSize(mid, availableSpace); + if (midValCmp < 0) { + lastBest = lo; + lo = mid + 1; + } else if (midValCmp > 0) { + hi = mid - 1; + lastBest = hi; + } else { + return mid; + } + } + // make sure to return last best + // this is what should always be returned + return lastBest; + + } + + @Override + protected void onTextChanged(final CharSequence text, final int start, + final int before, final int after) { + super.onTextChanged(text, start, before, after); + reAdjust(); + } + + @Override + protected void onSizeChanged(int width, int height, int oldwidth, + int oldheight) { + mTextCachedSizes.clear(); + super.onSizeChanged(width, height, oldwidth, oldheight); + if (width != oldwidth || height != oldheight) { + reAdjust(); + } + } +} diff --git a/app/src/main/java/com/hikapro/backpack/presenter/adapters/helper/items/swipe2/SwipableElement.java b/app/src/main/java/com/hikapro/backpack/presenter/adapters/helper/items/swipe2/SwipableElement.java index 07b1ff1..bf9f687 100644 --- a/app/src/main/java/com/hikapro/backpack/presenter/adapters/helper/items/swipe2/SwipableElement.java +++ b/app/src/main/java/com/hikapro/backpack/presenter/adapters/helper/items/swipe2/SwipableElement.java @@ -40,7 +40,6 @@ public class SwipableElement extends LinearLayout { private ScrollerCompat mOpenScroller; private ScrollerCompat mCloseScroller; private int mBaseX; - private int position; private Interpolator mCloseInterpolator; private Interpolator mOpenInterpolator; @@ -58,6 +57,7 @@ public class SwipableElement extends LinearLayout { mOpenInterpolator = openInterpolator; mContentView = contentView; mMenuView = menuView; + menuView.setSwipableElement(this); doSomething(); } diff --git a/app/src/main/java/com/hikapro/backpack/presenter/adapters/helper/items/swipe2/SwipableRecycler.java b/app/src/main/java/com/hikapro/backpack/presenter/adapters/helper/items/swipe2/SwipableRecycler.java index 5e8c8eb..ab16488 100644 --- a/app/src/main/java/com/hikapro/backpack/presenter/adapters/helper/items/swipe2/SwipableRecycler.java +++ b/app/src/main/java/com/hikapro/backpack/presenter/adapters/helper/items/swipe2/SwipableRecycler.java @@ -67,12 +67,6 @@ public class SwipableRecycler extends RecyclerView { if (lastTouchedElement != null && lastTouchedElement.isOpen() && lastTouchedElement != buf) { handled = true; } - // on click - /* - if (lastTouchedElement != null && lastTouchedElement.isOpen() && inRangeOfView(lastTouchedElement.getMenuView(), e)) { - lastTouchedElement.getMenuView().notifyOnClick(e.getRawX(), e.getRawY()); - } - */ if (lastTouchedElement != null) lastTouchedElement.onSwipe(e); return handled; @@ -91,13 +85,6 @@ public class SwipableRecycler extends RecyclerView { } return true; } - // TODO del - case MotionEvent.ACTION_UP: - // on click - if (lastTouchedElement != null && lastTouchedElement.isOpen() && inRangeOfView(lastTouchedElement.getMenuView(), e)) { - lastTouchedElement.getMenuView().notifyOnClick(e.getRawX(), e.getRawY()); - } - return super.onInterceptTouchEvent(e); } return super.onInterceptTouchEvent(e); } diff --git a/app/src/main/java/com/hikapro/backpack/presenter/adapters/helper/items/swipe2/SwipeMenuLayout.java b/app/src/main/java/com/hikapro/backpack/presenter/adapters/helper/items/swipe2/SwipeMenuLayout.java index 561a63f..9bd23c4 100644 --- a/app/src/main/java/com/hikapro/backpack/presenter/adapters/helper/items/swipe2/SwipeMenuLayout.java +++ b/app/src/main/java/com/hikapro/backpack/presenter/adapters/helper/items/swipe2/SwipeMenuLayout.java @@ -17,16 +17,7 @@ import java.util.List; public class SwipeMenuLayout extends LinearLayout { private SwipeMenu swipeMenu; - - private OnMenuItemClickListener menuItemClickListener; - - public OnMenuItemClickListener getMenuItemClickListener() { - return menuItemClickListener; - } - - public void setMenuItemClickListener(OnMenuItemClickListener menuItemClickListener) { - this.menuItemClickListener = menuItemClickListener; - } + private SwipableElement swipableElement; public SwipeMenuLayout(Context context) { super(context); @@ -40,6 +31,11 @@ public class SwipeMenuLayout extends LinearLayout { super(context, attrs, defStyleAttr); } + public void setSwipableElement(SwipableElement swipableElement) { + this.swipableElement = swipableElement; + } + + // adding menu with items public void addMenu(SwipeMenu menu) { swipeMenu = menu; List items = menu.getMenuItems(); @@ -49,7 +45,6 @@ public class SwipeMenuLayout extends LinearLayout { } } - private void addItem(SwipeMenuItem item, int id) { LayoutParams params = new LayoutParams(item.getWidth(),LayoutParams.MATCH_PARENT); @@ -68,6 +63,40 @@ public class SwipeMenuLayout extends LinearLayout { parent.addView(createTitle(item)); } } + // adding menu with items + listener + public void addMenu(SwipeMenu menu, OnClickListener listener) { + swipeMenu = menu; + List items = menu.getMenuItems(); + int id = 0; + for (SwipeMenuItem item : items) { + addItem(item, item.getId() == 0 ? ++id : item.getId(), listener); + } + } + + private void addItem(SwipeMenuItem item, int id, OnClickListener listener) { + + LayoutParams params = new LayoutParams(item.getWidth(),LayoutParams.MATCH_PARENT); + LinearLayout parent = new LinearLayout(getContext()); + parent.setId(id); + parent.setGravity(Gravity.CENTER); + parent.setOrientation(LinearLayout.VERTICAL); + parent.setLayoutParams(params); + parent.setBackgroundDrawable(item.getBackground()); + parent.setOnClickListener(listener); + addView(parent); + + if (item.getIcon() != null) { + parent.addView(createIcon(item)); + } + if (!TextUtils.isEmpty(item.getTitle())) { + parent.addView(createTitle(item)); + } + } + + public void notifyOnMenuItemClick() { + if (swipableElement != null && swipableElement.isOpen()) + swipableElement.smoothCloseMenu(); + } private ImageView createIcon(SwipeMenuItem item) { ImageView iv = new ImageView(getContext()); @@ -83,18 +112,6 @@ public class SwipeMenuLayout extends LinearLayout { tv.setTextColor(item.getTitleColor()); return tv; } - // should be raw coordinates - public void notifyOnClick(float x, float y) { - View menuItem = findViewAtPoint(x, y); - if (menuItem != null) { - if (menuItemClickListener != null) - menuItemClickListener.onMenuItemClick(menuItem); - } - } - - public interface OnMenuItemClickListener { - void onMenuItemClick(View v); - } private View findViewAtPoint(float x, float y) { View ret = null; diff --git a/app/src/main/java/com/hikapro/backpack/test/ScreenSlidePageFrag.java b/app/src/main/java/com/hikapro/backpack/test/ScreenSlidePageFrag.java deleted file mode 100644 index 9703b97..0000000 --- a/app/src/main/java/com/hikapro/backpack/test/ScreenSlidePageFrag.java +++ /dev/null @@ -1,9 +0,0 @@ -package com.hikapro.backpack.test; - -import android.app.Fragment; - -/** - * Created by tariel on 16/07/16. - */ -public class ScreenSlidePageFrag extends Fragment { -} diff --git a/app/src/main/java/com/hikapro/backpack/view/fragments/SetListFragment.java b/app/src/main/java/com/hikapro/backpack/view/fragments/SetListFragment.java index 55bbdce..4605eea 100644 --- a/app/src/main/java/com/hikapro/backpack/view/fragments/SetListFragment.java +++ b/app/src/main/java/com/hikapro/backpack/view/fragments/SetListFragment.java @@ -113,7 +113,10 @@ public class SetListFragment extends Fragment implements com.hikapro.backpack.vi @Override public void showItemList(Set set) { - activityCallback.startItemListFragment(set); + if (set.getActiveQty() == set.getPackedQty()) + activityCallback.startPackedListFragment(set); + else + activityCallback.startItemListFragment(set); } @Override diff --git a/app/src/main/res/drawable-hdpi/ic_check_box_outline_blank_white_24dp.png b/app/src/main/res/drawable-hdpi/ic_check_box_outline_blank_white_24dp.png new file mode 100644 index 0000000..443e73f Binary files /dev/null and b/app/src/main/res/drawable-hdpi/ic_check_box_outline_blank_white_24dp.png differ diff --git a/app/src/main/res/drawable-hdpi/ic_check_box_white_24dp.png b/app/src/main/res/drawable-hdpi/ic_check_box_white_24dp.png new file mode 100644 index 0000000..9f3bc73 Binary files /dev/null and b/app/src/main/res/drawable-hdpi/ic_check_box_white_24dp.png differ diff --git a/app/src/main/res/drawable-hdpi/ic_info_white.png b/app/src/main/res/drawable-hdpi/ic_info_white.png new file mode 100644 index 0000000..2d316a3 Binary files /dev/null and b/app/src/main/res/drawable-hdpi/ic_info_white.png differ diff --git a/app/src/main/res/drawable-mdpi/ic_check_box_outline_blank_white_24dp.png b/app/src/main/res/drawable-mdpi/ic_check_box_outline_blank_white_24dp.png new file mode 100644 index 0000000..c3c14dd Binary files /dev/null and b/app/src/main/res/drawable-mdpi/ic_check_box_outline_blank_white_24dp.png differ diff --git a/app/src/main/res/drawable-mdpi/ic_check_box_white_24dp.png b/app/src/main/res/drawable-mdpi/ic_check_box_white_24dp.png new file mode 100644 index 0000000..fa22907 Binary files /dev/null and b/app/src/main/res/drawable-mdpi/ic_check_box_white_24dp.png differ diff --git a/app/src/main/res/drawable-mdpi/ic_info_white.png b/app/src/main/res/drawable-mdpi/ic_info_white.png new file mode 100644 index 0000000..2d316a3 Binary files /dev/null and b/app/src/main/res/drawable-mdpi/ic_info_white.png differ diff --git a/app/src/main/res/drawable-xhdpi/ic_check_box_outline_blank_white_24dp.png b/app/src/main/res/drawable-xhdpi/ic_check_box_outline_blank_white_24dp.png new file mode 100644 index 0000000..6c335dc Binary files /dev/null and b/app/src/main/res/drawable-xhdpi/ic_check_box_outline_blank_white_24dp.png differ diff --git a/app/src/main/res/drawable-xhdpi/ic_check_box_white_24dp.png b/app/src/main/res/drawable-xhdpi/ic_check_box_white_24dp.png new file mode 100644 index 0000000..d159855 Binary files /dev/null and b/app/src/main/res/drawable-xhdpi/ic_check_box_white_24dp.png differ diff --git a/app/src/main/res/drawable-xhdpi/ic_info_white.png b/app/src/main/res/drawable-xhdpi/ic_info_white.png new file mode 100644 index 0000000..88acdc2 Binary files /dev/null and b/app/src/main/res/drawable-xhdpi/ic_info_white.png differ diff --git a/app/src/main/res/drawable-xxhdpi/ic_check_box_outline_blank_white_24dp.png b/app/src/main/res/drawable-xxhdpi/ic_check_box_outline_blank_white_24dp.png new file mode 100644 index 0000000..339e57c Binary files /dev/null and b/app/src/main/res/drawable-xxhdpi/ic_check_box_outline_blank_white_24dp.png differ diff --git a/app/src/main/res/drawable-xxhdpi/ic_check_box_white_24dp.png b/app/src/main/res/drawable-xxhdpi/ic_check_box_white_24dp.png new file mode 100644 index 0000000..3287ddf Binary files /dev/null and b/app/src/main/res/drawable-xxhdpi/ic_check_box_white_24dp.png differ diff --git a/app/src/main/res/drawable-xxhdpi/ic_info_white.png b/app/src/main/res/drawable-xxhdpi/ic_info_white.png new file mode 100644 index 0000000..9ed5c04 Binary files /dev/null and b/app/src/main/res/drawable-xxhdpi/ic_info_white.png differ diff --git a/app/src/main/res/drawable/checkbox_selector.xml b/app/src/main/res/drawable/checkbox_selector.xml new file mode 100644 index 0000000..fe67d3f --- /dev/null +++ b/app/src/main/res/drawable/checkbox_selector.xml @@ -0,0 +1,8 @@ + + + + + + \ No newline at end of file diff --git a/app/src/main/res/drawable/divider.xml b/app/src/main/res/drawable/divider.xml index c285233..2f37952 100644 --- a/app/src/main/res/drawable/divider.xml +++ b/app/src/main/res/drawable/divider.xml @@ -2,5 +2,5 @@ - + \ No newline at end of file diff --git a/app/src/main/res/drawable/divider2.xml b/app/src/main/res/drawable/divider2.xml new file mode 100644 index 0000000..9a66035 --- /dev/null +++ b/app/src/main/res/drawable/divider2.xml @@ -0,0 +1,6 @@ + + + + + \ No newline at end of file diff --git a/app/src/main/res/drawable/ic_check_box_outline_blank_white_24dp.png b/app/src/main/res/drawable/ic_check_box_outline_blank_white_24dp.png new file mode 100644 index 0000000..443e73f Binary files /dev/null and b/app/src/main/res/drawable/ic_check_box_outline_blank_white_24dp.png differ diff --git a/app/src/main/res/drawable/ic_check_box_white_24dp.png b/app/src/main/res/drawable/ic_check_box_white_24dp.png new file mode 100644 index 0000000..9f3bc73 Binary files /dev/null and b/app/src/main/res/drawable/ic_check_box_white_24dp.png differ diff --git a/app/src/main/res/drawable/ic_info_white.png b/app/src/main/res/drawable/ic_info_white.png new file mode 100644 index 0000000..2d316a3 Binary files /dev/null and b/app/src/main/res/drawable/ic_info_white.png differ diff --git a/app/src/main/res/drawable/list_background.png b/app/src/main/res/drawable/list_background.png new file mode 100644 index 0000000..e61c593 Binary files /dev/null and b/app/src/main/res/drawable/list_background.png differ diff --git a/app/src/main/res/layout/fragment_item_list.xml b/app/src/main/res/layout/fragment_item_list.xml index dd80d01..32757ea 100644 --- a/app/src/main/res/layout/fragment_item_list.xml +++ b/app/src/main/res/layout/fragment_item_list.xml @@ -9,7 +9,7 @@ android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertical" - android:background="@color/colorUiMainbackground2"> + android:background="@color/colorListBackground"> + android:background="@color/colorFooterBackground"> - + + android:background="@color/colorFooterBackground"> -